Closed
Bug 403423
Opened 17 years ago
Closed 17 years ago
PNG files with sRGB chunk displayed improperly when color_management is enabled
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla1.9beta2
People
(Reporter: glennrp+bmo, Assigned: glennrp+bmo)
References
()
Details
Attachments
(2 files, 5 obsolete files)
176 bytes,
image/png
|
Details | |
2.71 KB,
patch
|
tor
:
review+
pavlov
:
superreview+
damons
:
approval1.9+
|
Details | Diff | Splinter Review |
The attached image, which is a grayscale PNG with only IHDR, sRGB, IDAT, and IEND chunks, is displayed improperly when gfx.color_management is enabled. See bug #403239, comments 14-18. The bug is probably in libpr0n/decoders/png/nsPNGDecoder.cpp at line 409 which fails to test for the presence of a valid sRGB chunk.
Assignee | ||
Comment 1•17 years ago
|
||
This patch and the patch in bug #403239 will bit-rot each other.
Comment 2•17 years ago
|
||
I think your diff is horked.
Assignee | ||
Comment 3•17 years ago
|
||
Comment on attachment 288246 [details] [diff] [review] Fixes bug in sRGB handling in nsPNGDecoder.cpp Horked, indeed. No idea how that happened.
Attachment #288246 -
Attachment is obsolete: true
Assignee | ||
Comment 4•17 years ago
|
||
The other patch was horked by my fat finger hitting "]" and <ENTER> together instead of just <ENTER>.
Assignee | ||
Comment 5•17 years ago
|
||
Resolves merge conflict with checkin from bug #403239
Attachment #288251 -
Attachment is obsolete: true
Assignee | ||
Comment 6•17 years ago
|
||
Comment on attachment 288497 [details] [diff] [review] Fixes bug in sRGB handling in nsPNGDecoder.cpp (v2) The problem seems not to be the lack of a gAMA chunk but the handling of a grayscale PNG image with an sRGB chunk. See http://www.simplesystems.org/users/glennrp/srgb.
Attachment #288497 -
Attachment is obsolete: true
Assignee | ||
Comment 7•17 years ago
|
||
Changes grayscale to RGBA when sRGB is present and color_management is enabled.
Comment 8•17 years ago
|
||
Are you going to request review on your patch?
Assignee | ||
Comment 9•17 years ago
|
||
After I hear from someone that the patch works. Can't try it myself because I haven't got access to a platform with a sufficiently recent version of libpango installed, nor to the TriServer.
Comment 10•17 years ago
|
||
Hardware/OS -> All/All, since I see this in recent trunk Camino and Minefield on OS X PPC. I'll try to give this a test as soon as I finish pulling an updated tree.
OS: Windows XP → All
Hardware: PC → All
Comment 11•17 years ago
|
||
I can confirm the patch in comment 7 fixes this bug in a homemade build from this afternoon. Go ahead and target someone for review, as I have absolutely no idea whether or not this is the right approach. I just know that it worked. :)
Assignee | ||
Updated•17 years ago
|
Attachment #290035 -
Flags: review?(tor)
Comment 12•17 years ago
|
||
Comment on attachment 290035 [details] [diff] [review] Fixes bug in sRGB handling in nsPNGDecoder.cpp (v3) I think that line should be inside the "if profile {}" block", but otherwise it seems correct.
Assignee | ||
Comment 13•17 years ago
|
||
I agree, inside the "if (profile) {}" block would be better. New patch coming shortly.
Assignee | ||
Comment 14•17 years ago
|
||
Moved inside "if (profile) {}"
Attachment #290035 -
Attachment is obsolete: true
Attachment #290479 -
Flags: review?(tor)
Attachment #290035 -
Flags: review?(tor)
Assignee | ||
Comment 15•17 years ago
|
||
tor: Note that several other places the code has if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) png_set_gray_to_rgb(png_ptr); or similar. I omitted the test from the patch because it's redundant with tests inside libpng. I recommend removing all of them to save a few bytes of footprint. I'll post a new patch that does that if you like.
Assignee | ||
Comment 16•17 years ago
|
||
tor: The "v5" patch also removes the redundant tests -- take your pick of v4 or v5.
Attachment #290490 -
Flags: review+
Assignee | ||
Updated•17 years ago
|
Attachment #290479 -
Attachment is obsolete: true
Attachment #290479 -
Flags: review?(tor)
Attachment #290490 -
Flags: superreview?(pavlov)
Updated•17 years ago
|
Attachment #290490 -
Flags: superreview?(pavlov) → superreview+
Updated•17 years ago
|
Attachment #290490 -
Flags: approval1.9?
Updated•17 years ago
|
Attachment #290490 -
Flags: approval1.9? → approval1.9+
Comment 18•17 years ago
|
||
Checking in modules/libpr0n/decoders/png/nsPNGDecoder.cpp; /cvsroot/mozilla/modules/libpr0n/decoders/png/nsPNGDecoder.cpp,v <-- nsPNGDecoder.cpp new revision: 1.76; previous revision: 1.75 done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M10
Updated•17 years ago
|
Flags: in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•