]> granicus.if.org Git - imagemagick/blobdiff - coders/jp2.c
(no commit message)
[imagemagick] / coders / jp2.c
index 3280c69e79761cad673459c41652071d97ee1bcb..6c00cbb024f003fe900ff57d860ce96f68e9f402 100644 (file)
@@ -244,13 +244,13 @@ static int BlobWrite(jas_stream_obj_t *object,char *buffer,const int length)
   return((int) count);
 }
 
-static ssize_t BlobSeek(jas_stream_obj_t *object,ssize_t offset,int origin)
+static long BlobSeek(jas_stream_obj_t *object,long offset,int origin)
 {
   StreamManager
     *source;
 
   source=(StreamManager *) object;
-  return((ssize_t) SeekBlob(source->image,offset,origin));
+  return((long) SeekBlob(source->image,offset,origin));
 }
 
 static int BlobClose(jas_stream_obj_t *object)
@@ -260,7 +260,8 @@ static int BlobClose(jas_stream_obj_t *object)
 
   source=(StreamManager *) object;
   (void) CloseBlob(source->image);
-  source=(StreamManager *) RelinquishMagickMemory(source);
+  free(source);
+  source=(StreamManager *) NULL;
   return(0);
 }
 
@@ -523,8 +524,8 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception)
       break;
     for (i=0; i < (ssize_t) number_components; i++)
       (void) jas_image_readcmpt(jp2_image,(short) components[i],0,
-        ((unsigned int) y)/y_step[i],((unsigned int) image->columns)/x_step[i],
-        1,pixels[i]);
+        (jas_image_coord_t) (y/y_step[i]),(jas_image_coord_t) (image->columns/
+        x_step[i]),1,pixels[i]);
     switch (number_components)
     {
       case 1:
@@ -582,7 +583,8 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception)
     }
     if (SyncAuthenticPixels(image,exception) == MagickFalse)
       break;
-    status=SetImageProgress(image,LoadImageTag,y,image->rows);
+    status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
+                image->rows);
     if (status == MagickFalse)
       break;
   }
@@ -613,7 +615,7 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception)
           blob=(jas_stream_memobj_t *) icc_stream->obj_;
           if (image->debug != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "Profile: ICC, %lu bytes",(size_t) blob->len_);
+              "Profile: ICC, %.20g bytes",(double) blob->len_);
           profile=AcquireStringInfo(blob->len_);
           SetStringInfoDatum(profile,blob->buf_);
           icc_profile=(StringInfo *) GetImageProfile(image,"icc");
@@ -941,7 +943,8 @@ static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image)
     for (i=0; i < (ssize_t) number_components; i++)
       (void) jas_image_writecmpt(jp2_image,(short) i,0,(unsigned int) y,
         (unsigned int) image->columns,1,pixels[i]);
-    status=SetImageProgress(image,SaveImageTag,y,image->rows);
+    status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
+                image->rows);
     if (status == MagickFalse)
       break;
   }