PNG Images Printed Incorrectly

Bug #118089 reported by William Vann
4
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Invalid
Medium
Ubuntu
Invalid
Undecided
Unassigned

Bug Description

When printing PNG images, the images do not print correctly. Instead of the correct image, I get an image with its transparency showing as black areas and the colors of the image itself messed up. Tests performed in Eye of GNOME, Firefox, and the GIMP yield the following results:

* In Firefox, printing a PNG image on grey scale produces correct coloration, but incorrect transparency.

* In Eye of GNOME, printing a PNG image in color produces an image with incorrect coloring and transparency.

* In the GIMP, printing an image produces no result what so ever. The printer does nothing. Another bug, perhaps?

These are all the tests I have performed. Guidance would be appreciated.

Revision history for this message
In , Eyalroz (eyalroz) wrote :

Created attachment 112971
this image prints correctly

Revision history for this message
In , Eyalroz (eyalroz) wrote :

Created attachment 112972
this image prints incorrectly

Revision history for this message
In , Eyalroz (eyalroz) wrote :

Created attachment 112973
the HTML to print

Actually, testing the printing again, with the attachment links instead of my
local PNG files, now both images are misprinted for some reason.

Revision history for this message
In , Eyalroz (eyalroz) wrote :

This bug may be related to the PNG display bugs, 155470 and 146202, but it's not
a duplicate of them since the problem here is printing, not display.

Revision history for this message
In , Spam-minneboken (spam-minneboken) wrote :
Revision history for this message
In , Joe-confucius (joe-confucius) wrote :

on

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20021213

This URL triggers the bug

http://tubes.ominix.com/art/a/animals/hippopotamus-01.png

Revision history for this message
In , Tobi Reif (tobiasreif) wrote :

When I print
http://www.pinkjuice.com/howto/vimxml/pics/cos_pattern.png
in Mozilla (1.4.1, Windows ME) I get a black rectangle the size of the pic.

email: tobiasreif pinkjuice com

Revision history for this message
In , Dave-kimberley (dave-kimberley) wrote :

I can confirm this bug, transparent parts of the image print as black.

Revision history for this message
In , Claude-fortier (claude-fortier) wrote :

I confirm this bug with WinXp SP2, Firefox 1.0.7.

Revision history for this message
In , Eyalroz (eyalroz) wrote :

Created attachment 200918
the HTML to print

whoops, testcase HTML referred to the same image twice.

Revision history for this message
In , Jeanmichel-reghem (jeanmichel-reghem) wrote :

*** Bug 342325 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Edward Z. Yang (ezyang) wrote :

Confirming bug for Windows XP, Firefox 1.5, further confirming the probability that this is not driver related.

I have another image that has similar behavior. It was processed using Inkscape and Irfanview, if that helps at all.

Revision history for this message
In , Eyalroz (eyalroz) wrote :

What we need is someone who knows his way around the PNG format to tell us what's so special about these PNGs we're trying to print.

Revision history for this message
In , Bkausbk (bkausbk) wrote :

Confirmed here with Firefox 1.5.0.7 (Windows XP)

Revision history for this message
In , Kherron+mozilla (kherron+mozilla) wrote :

According to ImageMagick's "identify", the "correct" image has a white background, while the "incorrect" one has a black background. It sounds like the browser is mixing in the image's background color for transparent pixels.

It might be useful to try printing <http://entropymine.com/jason/testbed/pngtrans/>.

Revision history for this message
In , Edward Z. Yang (ezyang) wrote :

Created attachment 244732
Image logo that prints incorrectly, has white background

This image doesn't seem to have a black background.

Revision history for this message
In , Edward Z. Yang (ezyang) wrote :

Created attachment 244733
Correct image ImageMagick Verbose Identify

Adding ImageMagick identification for correct image.

Revision history for this message
In , Edward Z. Yang (ezyang) wrote :

Created attachment 244734
Incorrect image ImageMagick Verbose Identify

Revision history for this message
In , Edward Z. Yang (ezyang) wrote :

Created attachment 244735
Incorrect logo image ImageMagick Verbose Identify

Revision history for this message
In , Edward Z. Yang (ezyang) wrote :

I did some investigating, not sure this info will help though, as I was unable to pinpoint the crucial difference.

Definitely doesn't affect it: Interlacing

The correct and incorrect images are actually quite different in composition. The correct one is:

- DirectClass
- Grayscale
- Gray alpha
- Has a white background color

While the incorrect one is:

- Pseudomap
- Grayscale
- Gray alpha
- Uses a colormap that's 256 large
- Has a non-standard resolution
- Has a rgb(1,1,1) background color.

The incorrect logo image is:

- Directmap
- RGB with 8-bit channels
- Transparent Alpha
- White background color

When I convert the logo image to grayscale using Irfanview, then the image prints properly. When I convert it to monochrome using ImageMagick, it still fails to print properly. I note that the latter used a colormap, the former did not. In fact, the monochrome version of the logo is extremely similar to incorrect image due as: both use PseudoClass and a color map. The only substantial difference is that while the incorrect image has 8-bit gray and 1-bit alpha, the incorrect monochrome logo image has 1-bit gray and 8-bit alpha.

Unfortunately, I still have been unable to get correct printing for RGB color PNGs with transparency. Can anyone else help?

Revision history for this message
William Vann (wrvann) wrote :

When printing PNG images, the images do not print correctly. Instead of the correct image, I get an image with its transparency showing as black areas and the colors of the image itself messed up. Tests performed in Eye of GNOME, Firefox, and the GIMP yield the following results:

* In Firefox, printing a PNG image on grey scale produces correct coloration, but incorrect transparency.

* In Eye of GNOME, printing a PNG image in color produces an image with incorrect coloring and transparency.

* In the GIMP, printing an image produces no result what so ever. The printer does nothing. Another bug, perhaps?

These are all the tests I have performed. Guidance would be appreciated.

Revision history for this message
Murat Gunes (mgunes) wrote :

Thanks for your report.

Could you attach the file you're trying to print, to make sure we'll stay on the same page? Please also provide your printer model and the driver it's using.

I'm led to think this may be a libpng issue, since there are symptoms with multiple software, but they may also be separate bugs.

Do you observe the same behaviour when printing to a file these software?

Revision history for this message
Murat Gunes (mgunes) wrote :

And that pun was entirely unintended; I've just noticed it :)

Revision history for this message
William Vann (wrvann) wrote :

My printer model is "HP D2445", its driver, "hpijs". FYI: The only discrepancy which exists on the printer detection is under the category of "Model", where I was forced to select "D2300" instead of the correct one. The file I printed with Eye of GNOME is attached, here are the web addresses that I attempted to print from as well (pay particular attention to the second one: it prints just HORRIBLY, perhaps because it has frames):

http://ubuntuforums.org/showthread.php?t=451191 http://anywherebb.com/index.php?chat=off_bottom_fixed

Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
In , Timeless-bemail (timeless-bemail) wrote :

*** Bug 235097 has been marked as a duplicate of this bug. ***

Changed in firefox:
status: Confirmed → Invalid
Revision history for this message
John Vivirito (gnomefreak) wrote :

This doesnt sound like a firefox bug as it happens in gimp and eye of gnome, i just moved upstream bug to correct bug # since they marked the old one a dupe.
I will keep my eye on this.

Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
In , Eatchuta (eatchuta) wrote :

My apologies if it's improper or wrong to ask this here, but could someone please look into fixing this print problem? PNG images are growing more popular every day, and I see them make beautiful additions to many websites.

Considering this bug was first reported 4 years ago, with dozens of duplicates appearing since then, and now IE is the one printing images better, I really hope this will be given slightly more priority than it has.

Someone even suggested a correction in a patch (see duplicate bug 235097), but it sadly wasn't up to code with current codepaths, so it was promptly ignored and discarded. Perhaps someone could look into that and making a proper addition to Firefox 3?

Please help someone! What we see is not what prints! Much appreciate it.

Revision history for this message
In , Bugzilla-game-point (bugzilla-game-point) wrote :

D. Rippstein,

Tell me about it. I've been saying about this bug for ages, and I'd fix it, but I'm not a print guru. And I suspect that's the problem - nobody coding FF right now really is. At least, that's the best reason I know that it hasn't been fixed. Firefox's printing is getting quite embarrassingly bad now. I think it's about time MoCo hired a printing guru.

Revision history for this message
In , Niemayer (niemayer) wrote :

@D.Rippstein: It's not 4 years, but at least 5 years ago that this bug was reported, see https://bugzilla.mozilla.org/show_bug.cgi?id=141656

@Jeremy: I'd like to second your observation that printing in FF has become nothing but an embarresment. And it's not just "cosmetic" problems like the one this ticket is about - if you e.g. try to print Germany's most popular news-page - www.spiegel.de - Firefox will enter an endless loop (there is another ticket on that).

Too sad that FF development is heading to add new colorful toys every month instead of fixing basic functionality like printing.

Revision history for this message
In , Mats Palmgren (matspal) wrote :

Does the problem still occur in a recent trunk build?
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/

Revision history for this message
In , Eyalroz (eyalroz) wrote :

With 2007-09-22, both images print incorrectly...

Revision history for this message
In , Mozilla-bugs-elitemail (mozilla-bugs-elitemail) wrote :

The trunk build downloaded 01-October-2007 prints images correctly as far as I can tell --- when will this fix become part of a primary distribution???

Revision history for this message
In , Moz-jeka (moz-jeka) wrote :

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a9pre) Gecko/2007092504 Minefield/3.0a9pre
(In reply to comment #25)
> Does the problem still occur in a recent trunk build?
Attachment 112972 WFM on trunk. Someone with permissions should close this bug.

(In reply to comment #27)
> when will this fix become part of a primary distribution???
Gecko 1.9 (FF 3) is expected end of 2007 (or later, IMHO). First beta in October.

Revision history for this message
In , Mats Palmgren (matspal) wrote :

Thanks for testing.

-> WORKSFORME

Changed in firefox:
status: Confirmed → Invalid
Revision history for this message
In , Mozbug1 (mozbug1) wrote :

Testing with the nightly shows that the start and end points of a route on Google Maps do not apply transparency correctly in the print preview.

Url I used for testing:

http://maps.google.com/maps?f=d&hl=en&geocode=&time=&date=&ttype=&saddr=860+E+2+St,+Brooklyn,+NY+11230&daddr=1050+e+2+st&sll=40.625386,-73.968136&sspn=0.005032,0.009956&ie=UTF8&ll=40.626062,-73.975121&spn=0.005032,0.009956&z=17&om=1

 Tested with: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9a9pre) Gecko/2007100804 Minefield/3.0a9pre

Revision history for this message
In , Moz-jeka (moz-jeka) wrote :

(In reply to comment #30)

1. This bug is about confusing black and white.
2. This bug is about printing, print preview is irrelevant.
3. I can confirm. Print preview looks bad at all with your example, compared with Opera (white lines between the seperate images).

So it's probably a known bug (or two). Please file a new one, if you cant't find it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Ubuntu because there has been no activity for 60 days.]

Revision history for this message
In , Moz-jeka (moz-jeka) wrote :

*** Bug 466635 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Bugzilla-game-point (bugzilla-game-point) wrote :

I've investigated this, and come to the conclusion that Firefox's behaviour is correct, and Google Maps' code is incorrect. My full explanation is here:
http://www.game-point.net/misc/googlemaps/

Please bug Google Maps to fix their code. I have no idea why they tell the browser to print non-transparent GIFs instead of the perfectly good transparent PNGs used on the browser screen.

Revision history for this message
In , Antoine-mechelynck-gmail (antoine-mechelynck-gmail) wrote :

In reply to comment #33:

So the site is broken. Reporter, you might be interested in http://www.mozilla.org/projects/tech-evangelism/site/procedures.html

Revision history for this message
In , Moz-jeka (moz-jeka) wrote :

Tony, this bug works, confirmed in comment 27 and 28. The original issue was printing attachment 112972.

Comment 33 is unrelated and is probably talking about bug 282434 "fails to correctly print route maps in Google Maps".

Revision history for this message
In , Antoine-mechelynck-gmail (antoine-mechelynck-gmail) wrote :

(In reply to comment #35)
> Tony, this bug works, confirmed in comment 27 and 28. The original issue was
> printing attachment 112972 [details].

Ah, sorry. Well, whoever wants to bug Google can file a Tech-Ev bug and follow the procedures in the URL in comment #34.

Revision history for this message
In , Bugzilla-game-point (bugzilla-game-point) wrote :

(In reply to comment #34)
> In reply to comment #33:
>
> So the site is broken. Reporter, you might be interested in
> http://www.mozilla.org/projects/tech-evangelism/site/procedures.html

I've had a reply from a Google dev after posting in their groups about this:

> Hi Jeremy (Jez),
>
> Your analysis of the printing bug is dead-on, all except for the reasons
> behind it. Firefox 1 and 2 had a nasty habit of printing transparent pixels
> in an image as solid black (you can still see this in the waypoint markers if
> you install FF2), so we added this "compromise" to print non-transparent
> light gray instead. This behavior was FINALLY fixed in firefox 3, although
> we didn't notice for a while.
>
> I'll be fixing this bug soon, although it won't make it to production
> immediately, especially during the holidays.

So looks like we won't need to evangelize on this one. :-D

Revision history for this message
In , Moz-jeka (moz-jeka) wrote :

Jeremy, while your investigation is interesting (thanks!), Google Maps printing issues are unrelated here. This bug is about wrong printing of some transparent PNGs in general.
This bug is closed as WORKSFORME since 2007-10-02 in 1.9 (Fx3), as long as attachment 112972 prints correctly.

Google's old workaround, resulting from this bug, is probably bug 282434 or part of it. If that's the case, comment in that bug. People CCd there might be interested.

Thanks again for your investigation!

Changed in firefox:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.