Bug 25730 - png import of 1-bit grayscale does not work
Summary: png import of 1-bit grayscale does not work
Status: RESOLVED WORKSFORME
Alias: None
Product: cairo
Classification: Unclassified
Component: png functions (show other bugs)
Version: 1.9.4
Hardware: x86 (IA32) Linux (All)
: high major
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-20 05:20 UTC by Alois
Modified: 2010-03-01 21:31 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
png file to illustrate problem (10.19 KB, image/png)
2009-12-20 05:20 UTC, Alois
Details
Program to exercise loading an image. (1.20 KB, text/x-csrc)
2010-03-01 21:27 UTC, M Joonas Pihlaja
Details

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.