Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magick xc:black black.pnm creates a white image #1636

Closed
3 tasks done
cjmayo opened this issue Jul 14, 2019 · 1 comment
Closed
3 tasks done

magick xc:black black.pnm creates a white image #1636

cjmayo opened this issue Jul 14, 2019 · 1 comment

Comments

@cjmayo
Copy link

cjmayo commented Jul 14, 2019

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am using the latest version of ImageMagick
  • I have searched open and closed issues to ensure it has not already been reported

Description

Fix from #1632 resolved issue with:
magick -size 100x100 xc:white white.pnm
but broke:
magick -size 100x100 xc:black black.pnm
which now creates a white image.

Steps to Reproduce

  1. magick -size 100x100 xc:black black.pnm
  2. View black.pnm and see it is white instead of the expected black

System Configuration

  • ImageMagick version: 7.0.8-53 +
--- a/coders/pnm.c
+++ b/coders/pnm.c
@@ -1944,7 +1944,7 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image,
         if (quantum_info == (QuantumInfo *) NULL)
           ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
         (void) SetQuantumEndian(image,quantum_info,MSBEndian);
-        quantum_info->min_is_white=MagickTrue;
+        quantum_info->min_is_white=MagickFalse;
         pixels=GetQuantumPixels(quantum_info);
         for (y=0; y < (ssize_t) image->rows; y++)
         {
  • Environment (Operating system, version and so on): Gentoo Linux
  • Additional information:
urban-warrior pushed a commit to ImageMagick/ImageMagick6 that referenced this issue Jul 14, 2019
@urban-warrior
Copy link
Member

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants