Bug 25730

Summary: png import of 1-bit grayscale does not work
Product: cairo Reporter: Alois <alois>
Component: png functionsAssignee: Carl Worth <cworth>
Status: RESOLVED WORKSFORME QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: major    
Priority: high    
Version: 1.9.4   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: png file to illustrate problem
Program to exercise loading an image.

Description Alois 2009-12-20 05:20:35 UTC
Created attachment 32205 [details]
png file to illustrate problem

When I import 1-bit grayscale PNG images into PDF or Postscript context, the imported image is shoing garbage. The size is correct, but what I see is a green and black rectangle instead of the same image.

The linux 'file' command on the image file says:
t409.1bit.png: PNG image data, 685 x 295, 1-bit grayscale, non-interlaced

When I convert the image to a 1-bit colourmap, it works.
The linux 'file' result is
t409.png:      PNG image data, 685 x 295, 1-bit colormap, non-interlaced
Comment 1 Alois 2010-01-13 00:44:29 UTC
The bug is still in snapshot 1.9.4 and it also applies to image surfaces.

It seems that grayscale PNG cannot be imported into cairo at all.
Comment 2 M Joonas Pihlaja 2010-03-01 21:27:23 UTC
Created attachment 33675 [details]
Program to exercise loading an image.
Comment 3 M Joonas Pihlaja 2010-03-01 21:31:20 UTC
I can't reproduce this bug with Debian stable running on a x86_64 box using the previously attached program.  The program loads the image from comment #1 correctly and produces totally opaque output files out-bug-25730-{a1,a8}.png as expected, as well as out-bug-25730-{rgb,argb}.png which contain the input image.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.