From 96bc620815234aaec28b928df51d1754cbe390dc Mon Sep 17 00:00:00 2001 From: glennrp Date: Tue, 3 Dec 2013 19:21:04 +0000 Subject: [PATCH] Fixed bug in coders/png.c that caused -define png:color-space=0 to fail. --- coders/png.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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. */ -- 2.40.0