]> granicus.if.org Git - imagemagick/blobdiff - coders/jpeg.c
(no commit message)
[imagemagick] / coders / jpeg.c
index e855783b65ac18c7fe0076c701bb500c2d04bf4d..5e349a473f7edad260aba9ac3a769e74385b851a 100644 (file)
@@ -520,7 +520,10 @@ static boolean ReadIPTCProfile(j_decompress_ptr jpeg_info)
     }
   else
     {
-      status=SetImageProfile(image,"8bim",profile);
+      if (strcmp((char *) GetStringInfoDatum(profile),"8BIM") != 0)
+        status=SetImageProfile(image,"iptc",profile);
+      else
+        status=SetImageProfile(image,"8BIM",profile);
       profile=DestroyStringInfo(profile);
       if (status == MagickFalse)
         ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
@@ -1525,11 +1528,11 @@ static void WriteProfile(j_compress_ptr jpeg_info,Image *image)
           *p;
 
         tag_length=14;
+        p=GetStringInfoDatum(custom_profile);
         (void) CopyMagickMemory(p,ICC_PROFILE,tag_length);
         for (i=0; i < (ssize_t) GetStringInfoLength(profile); i+=65519L)
         {
           length=MagickMin(GetStringInfoLength(profile)-i,65519L);
-          p=GetStringInfoDatum(custom_profile);
           p[12]=(unsigned char) ((i/65519L)+1);
           p[13]=(unsigned char) (GetStringInfoLength(profile)/65519L+1);
           (void) CopyMagickMemory(p+tag_length,GetStringInfoDatum(profile)+i,