Closed Bug 135579 Opened 24 years ago Closed 24 years ago

Small interlaced PNG images are decoded incorrectly

Categories

(Core :: Graphics: ImageLib, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: jason1, Assigned: tor)

References

()

Details

Attachments

(1 file, 1 obsolete file)

Certain small pixel sizes of interlaced PNG images are not displayed correctly. Some of the pixels are displayed in the wrong colors (colors that appear elsewhere in the image). For example, when Mozilla tries to display a 2-pixel interlaced PNG having one red and one blue pixel, it makes both pixels blue. The image sizes that don't work are: (width x height) 1x2, 1x3, 1x4, 2x1, 2x2, 2x3, 2x4 I tested 8-bpp palette images and 24-bpp RGB images, with identical results. I haven't tested other image types. [build id: 2002040403]
Netscape 4.7x has similar problems with this test case. IE5.5 displays it properly. This needs to be resolved. Glenn
Jason, what version of libpng did you use? There was a bug with narrow interlaced PNGs that was fixed in libpng-1.0.9. Glenn
I created the test images with either libpng 1.2.1 or one of the 1.2.2 betas; not sure which. I'm not 100.0% sure they are valid images, but most software seems to be able to handle them. I discovered the problem when investigating why the background on someone else's web site didn't display consistently. It was using a 2-pixel PNG (apparently created with ImageReady) as a background image, which I've copied here: http://entropymine.com/jason/testbed/intltest/test1.png (You have to look closely, as the pixels are similar in color.) BTW, I've added a couple of screen shots to my test page, to show what I see in Mozilla, and how I think it should be displayed.
I meant, which version of libpng did you use to build your Mozilla? Glenn
I looked over the images with a few tools (pngcrush -v, imagemagick, od, pngcheck -v) and there seems to be nothing wrong with them. Glenn
I didn't build it myself. Recent Windows builds of Mozilla include a file named "imgpng.dll" which contains the string "1.0.9" a few times, so that'd be my guess as to the libpng version in use.
Any chance of getting this bug confirmed sometime...?
Summary: Small interlaced PNG images displayed incorrectly → Small interlaced PNG images are decoded incorrectly
Confirmed under Linux with Mozilla 1.0 release; the results are identical to the Windows screenshot, aside from the background (which is white in both screenshots but cyan in Moz 1.0--presumably the older page used in the screenshots didn't have the two-pixel image as a background). strings(1) on components/libimgpng.so indicates it's using libpng 1.0.9. W.r.t. comment #1, NN 4.x's problems are indeed similar but not identical; it completely fails to show 7 of the images, and it has problems with some of the 4xN and Nx5 images. So this isn't a 4xp regression. Opera 6.0 TP1 displays everything correctly. Greg
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 98 → All
> Confirmed under Linux with Mozilla 1.0 release; Also under Windows 95 running on Pentium/MMX > the results are identical to the > Windows screenshot, aside from the background (which is white in both > screenshots but cyan in Moz 1.0--presumably the older page used in the > screenshots didn't have the two-pixel image as a background It's not supposed to be cyan. Under IE it's the vertically striped red/green as in the box labelled "green", and the text is really ugly red, black, and green due to interference patterns. Would someone please build mozilla with libpng-1.2.3 and see if the problems go away? Has the problem been confirmed on a non-MMX platform? Glenn
With the 1.0.9 currently in the tree we don't enable the MMX code for either windows or linux. Compiling mozilla against libpng-1.2.3 fixes the problem. While I was planning up updating moz's libpng in the trunk once the flury of 1.2.x updates dies down, we can't do large code drops like that in the 1.0.x branch. If you want it fixed there we'll need a minimal patch.
This patch upgrades pngpread.c from version 1.0.9 to 1.0.10, in which the bug with loading small interlaced PNG files has been fixed.
Attachment #87849 - Attachment is obsolete: true
rs=tor for a change that's been baking in libpng since 1.0.10 (March 2001).
Checked into trunk.
Attachment #87852 - Flags: approval+
please checkin to the 1.0.1 branch. once there, remove the "mozilla1.0.1+" keyword and add the "fixed1.0.1" keyword.
Keywords: mozilla1.0.1+
Checked in on branch.
Taking...
Assignee: pavlov → tor
Fix in trunk/branch - closing.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified fixed linux branch build 2002070907, win xp branch build 2002070908 and Mac OS X branch build 2002070810
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: