]> granicus.if.org Git - imagemagick/blobdiff - coders/meta.c
(no commit message)
[imagemagick] / coders / meta.c
index f48eefb7267f125b90d23bca6215806c10b12472..640ce18269e30453a51d814a2596980f74c78fbb 100644 (file)
@@ -17,7 +17,7 @@
 %                                 July 2001                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -419,7 +419,7 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile)
                     offset=SeekBlob(ofile,savedpos,SEEK_SET);
                     if (offset < 0)
                       return(-1);
-                    (void) WriteBlobMSBLong(ofile,(size_t) diff);
+                    (void) WriteBlobMSBLong(ofile,(unsigned int) diff);
                     offset=SeekBlob(ofile,currentpos,SEEK_SET);
                     if (offset < 0)
                       return(-1);
@@ -447,7 +447,7 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile)
                   }
                 if (recnum != IPTC_ID)
                   {
-                    (void) WriteBlobMSBLong(ofile, (size_t) len);
+                    (void) WriteBlobMSBLong(ofile, (unsigned int) len);
                     outputlen += 4;
 
                     next=0;
@@ -465,7 +465,7 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile)
                   {
                     /* patch in a fake length for now and fix it later */
                     savedpos = TellBlob(ofile);
-                    (void) WriteBlobMSBLong(ofile,0xFFFFFFFFUL);
+                    (void) WriteBlobMSBLong(ofile,0xFFFFFFFFU);
                     outputlen += 4;
                     savedolen = outputlen;
                   }
@@ -506,7 +506,7 @@ static ssize_t parse8BIM(Image *ifile, Image *ofile)
       offset=SeekBlob(ofile,savedpos,SEEK_SET);
       if (offset < 0)
         return(-1);
-      (void) WriteBlobMSBLong(ofile,(size_t) diff);
+      (void) WriteBlobMSBLong(ofile,(unsigned int) diff);
       offset=SeekBlob(ofile,currentpos,SEEK_SET);
       if (offset < 0)
         return(-1);
@@ -695,7 +695,7 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile)
                     offset=SeekBlob(ofile,savedpos,SEEK_SET);
                     if (offset < 0)
                       return(-1);
-                    (void) WriteBlobMSBLong(ofile,(size_t) diff);
+                    (void) WriteBlobMSBLong(ofile,(unsigned int) diff);
                     offset=SeekBlob(ofile,currentpos,SEEK_SET);
                     if (offset < 0)
                       return(-1);
@@ -723,7 +723,7 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile)
                   }
                 if (recnum != IPTC_ID)
                   {
-                    (void) WriteBlobMSBLong(ofile,(size_t) len);
+                    (void) WriteBlobMSBLong(ofile,(unsigned int) len);
                     outputlen += 4;
 
                     next=0;
@@ -741,7 +741,7 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile)
                   {
                     /* patch in a fake length for now and fix it later */
                     savedpos = TellBlob(ofile);
-                    (void) WriteBlobMSBLong(ofile,0xFFFFFFFFUL);
+                    (void) WriteBlobMSBLong(ofile,0xFFFFFFFFU);
                     outputlen += 4;
                     savedolen = outputlen;
                   }
@@ -781,7 +781,7 @@ static ssize_t parse8BIMW(Image *ifile, Image *ofile)
       offset=SeekBlob(ofile,savedpos,SEEK_SET);
       if (offset < 0)
         return(-1);
-      (void) WriteBlobMSBLong(ofile,(size_t) diff);
+      (void) WriteBlobMSBLong(ofile,(unsigned int) diff);
       offset=SeekBlob(ofile,currentpos,SEEK_SET);
       if (offset < 0)
         return(-1);
@@ -1307,8 +1307,8 @@ static Image *ReadMETAImage(const ImageInfo *image_info,
         }
       AttachBlob(buff->blob,blob,length);
       /* write out the header - length field patched below */
-      (void) WriteBlob(buff,11,(unsigned char *) "8BIM\04\04\0\0\0\0\01");
-      (void) WriteBlobByte(buff,0xe0);
+      (void) WriteBlob(buff,11,(unsigned char *) "8BIM\04\04\0\0\0\0\0");
+      (void) WriteBlobByte(buff,0xc6);
       if (LocaleCompare(image_info->magick,"IPTCTEXT") == 0)
         {
           length=(size_t) parse8BIM(image,buff);
@@ -2187,7 +2187,7 @@ static int format8BIM(Image *ifile, Image *ofile)
           return(-1);
       }
     }
-    count = (ssize_t) ReadBlobMSBLong(ifile);
+    count = (int) ReadBlobMSBLong(ifile);
     if (count < 0) return -1;
     /* make a buffer to hold the datand snag it from the input stream */
     str=(unsigned char *) AcquireQuantumMemory((size_t) count,sizeof(*str));
@@ -2280,7 +2280,9 @@ static MagickBooleanType WriteMETAImage(const ImageInfo *image_info,
       unsigned char
         *info;
 
-      profile=GetImageProfile(image,"8bim");
+      profile=GetImageProfile(image,"iptc");
+      if (profile == (StringInfo *) NULL)
+        profile=GetImageProfile(image,"8bim");
       if (profile == (StringInfo *) NULL)
         ThrowWriterException(CoderError,"No8BIMDataIsAvailable");
       status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);