]> granicus.if.org Git - imagemagick/commitdiff
Fixed bug in coders/png.c that caused -define png:color-space=0 to fail.
authorglennrp <glennrp@git.imagemagick.org>
Tue, 3 Dec 2013 19:21:04 +0000 (19:21 +0000)
committerglennrp <glennrp@git.imagemagick.org>
Tue, 3 Dec 2013 19:21:04 +0000 (19:21 +0000)
coders/png.c

index a3568bd484e0d49387d26d454836ebd62e4c169c..23147a148406a6ca679a65c90c5044d66352a755 100644 (file)
@@ -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. */