From: glennrp Date: Tue, 3 Dec 2013 19:21:04 +0000 (+0000) Subject: Fixed bug in coders/png.c that caused -define png:color-space=0 to fail. X-Git-Tag: 7.0.1-0~3064 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96bc620815234aaec28b928df51d1754cbe390dc;p=imagemagick Fixed bug in coders/png.c that caused -define png:color-space=0 to fail. --- diff --git a/coders/png.c b/coders/png.c index a3568bd48..23147a148 100644 --- a/coders/png.c +++ b/coders/png.c @@ -8284,7 +8284,9 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, } } - if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse) + if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse && + image->colorspace != Rec601LumaColorspace && + image->colorspace != Rec709LumaColorspace) (void) TransformImageColorspace(image,sRGBColorspace,exception); /* @@ -8800,9 +8802,12 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, ping_have_color=MagickFalse; ping_have_non_bw=MagickFalse; - if ((IssRGBCompatibleColorspace(image->colorspace) == MagickFalse) || - (IssRGBColorspace(image->colorspace) != MagickFalse)) + if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse && + image->colorspace != Rec601LumaColorspace && + image->colorspace != Rec709LumaColorspace) { + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "incompatible colorspace"); ping_have_color=MagickTrue; ping_have_non_bw=MagickTrue; } @@ -9673,7 +9678,6 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, if (mng_info->IsPalette && mng_info->write_png8) { - /* To do: make this a function cause it's used twice, except for reducing the sample depth from 8. */