]> granicus.if.org Git - imagemagick/commitdiff
Accept defined compression-filter=6,7,8,9 to be consistent with -quality option.
authorglennrp <glennrp@git.imagemagick.org>
Fri, 1 Jul 2011 19:02:13 +0000 (19:02 +0000)
committerglennrp <glennrp@git.imagemagick.org>
Fri, 1 Jul 2011 19:02:13 +0000 (19:02 +0000)
coders/png.c

index 1abebc378853f2238f336def94ec66b7baeebf2f..df31f4d4fb7466f2db6d08cc31e2709485039271 100644 (file)
@@ -10733,9 +10733,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
 %  the user should make sure that ImageMagick has already reduced the
 %  image depth and number of colors and limit transparency to binary
 %  transparency prior to attempting to write the image with depth, color,
-%   or transparency limitations.
-%
-%  To do: Enforce the previous paragraph.
+%  or transparency limitations.
 %
 %  Note that another definition, "png:bit-depth-written" exists, but it
 %  is not intended for external use.  It is only used internally by the
@@ -10995,8 +10993,6 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info,
      value=GetImageOption(image_info,"png:compression-level");
   if (value != NULL)
   {
-      /* To do: use a "LocaleInteger:()" function here. */
-
       /* We have to add 1 to everything because 0 is a valid input,
        * and we want to use 0 (the default) to mean undefined.
        */
@@ -11104,6 +11100,17 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info,
       else if (LocaleCompare(value,"5") == 0)
         mng_info->write_png_compression_filter = 6;
 
+      else if (LocaleCompare(value,"6") == 0)
+        mng_info->write_png_compression_filter = 7;
+
+      else if (LocaleCompare(value,"7") == 0)
+        mng_info->write_png_compression_filter = 8;
+
+      else if (LocaleCompare(value,"8") == 0)
+        mng_info->write_png_compression_filter = 9;
+
+      else if (LocaleCompare(value,"9") == 0)
+        mng_info->write_png_compression_filter = 10;
 
       else
         (void) ThrowMagickException(&image->exception,