]> granicus.if.org Git - imagemagick/commitdiff
Added option to preserve a corrupt image to the png coder.
authordirk <dirk@git.imagemagick.org>
Tue, 21 Apr 2015 21:05:39 +0000 (21:05 +0000)
committerdirk <dirk@git.imagemagick.org>
Tue, 21 Apr 2015 21:05:39 +0000 (21:05 +0000)
coders/png.c

index cf8cf8a3855218b3e10e66e47acc8fc11b968478..108e844927528fb42a52eb4a740cad8b531f9daf 100644 (file)
@@ -2180,7 +2180,14 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
           "  exit ReadOnePNGImage() with error.");
 
       if (image != (Image *) NULL)
-        image->columns=0;
+        {
+          const char
+            *option;
+
+          option=GetImageOption(image_info,"png:preserve-corrupt-image");
+          if (IsStringTrue(option) == MagickFalse)
+            image->columns=0;
+        }
 
       return(GetFirstImageInList(image));
     }