From 057a5d2cf6f95e2fbea1dc2abec0bc9463f77052 Mon Sep 17 00:00:00 2001 From: dirk Date: Tue, 21 Apr 2015 21:05:39 +0000 Subject: [PATCH] Added option to preserve a corrupt image to the png coder. --- coders/png.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/coders/png.c b/coders/png.c index cf8cf8a38..108e84492 100644 --- a/coders/png.c +++ b/coders/png.c @@ -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)); } -- 2.40.0