]> granicus.if.org Git - imagemagick/commitdiff
Fixed new "-define png:swap-bytes" option.
authorglennrp <glennrp@git.imagemagick.org>
Thu, 30 Jan 2014 18:58:51 +0000 (18:58 +0000)
committerglennrp <glennrp@git.imagemagick.org>
Thu, 30 Jan 2014 18:58:51 +0000 (18:58 +0000)
coders/png.c

index ad9c4bc92e94155d6f6e03fd2a3827321efd1970..37ac82d2f06390b4666e7da3a8000ba1f4cb72b3 100644 (file)
@@ -2465,20 +2465,15 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
   if (ping_file_depth == 16)
   {
      const char
-       *property;
-
-     property=(const char *) NULL;
-     ResetImagePropertyIterator(image);
-     property=GetNextImageProperty(image);
-     while (property != (const char *) NULL)
-       {
-         (void) GetImageProperty(image,property,exception);
-
-         if (LocaleNCompare(property,"png:swap-bytes",14) != 0)
-           png_set_swap(ping);
-
-         property=GetNextImageProperty(image);
-       }
+       *value;
+     value=GetImageOption(image_info,"png:swap-bytes");
+     if (value == NULL)
+        value=GetImageArtifact(image,"png:swap-bytes");
+     if (value != NULL)
+        png_set_swap(ping);
   }
 
   /* Save bit-depth and color-type in case we later want to write a PNG00 */
@@ -11276,7 +11271,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
        * "identify" or for passing through to another JPEG
        */
       if ((LocaleNCompare(property,"png:",4) != 0 &&
-           LocaleNCompare(property,"jpeg:",5)) &&
+           LocaleNCompare(property,"jpeg:",5) != 0) &&
 
 
           /* Suppress density and units if we wrote a pHYs chunk */