Summary: | Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | fwdyi <c6537875> | ||||||||||
Component: | WebKit Misc. | Assignee: | Don Olmstead <don.olmstead> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | bburg, commit-queue, don.olmstead, Hironori.Fujii, inspector-bugzilla-changes, jfrie, joepeck, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Attachments: |
|
Description
fwdyi
2018-09-02 04:14:15 PDT
Would you be interested in writing a patch? I don't have a way to test this easily myself, as the Mac port does not use libpng this way (AFAIK). I chased the same bug down and arrived here to report it. The fix simply requires running imagemagick on the filed as described in the SO question: "mogrify foo.png". You can verify the fix by grepping the (binary) file for the chunk tag "iCCP". After repairing the files grep should report a non-match. I would submit a patch, but the tree snapshot is 1.8GB compressed (!) and that's too much to ask. Since the files have been there for 7 years, and libpng1.6 has been yelling for 5, this may seem like a minor nuisance. But my system's log files are littered with these messages, so it *would* be great to fix this. Reported to downstream QWebKit as well: https://bugreports.qt.io/browse/QTBUG-71134 Please respond. This is a trivial fix for a problem which has been ongoing for years. I've been advised by Kevin Kofler on the Redhat bugzilla that pngcrush -ow -fix file.png (overwrite file in place, fix) is a better choice, since it strips the bad tag without altering the image data, whereas mogrify recompresses it. I've verified that running the command twice on the same file doesn't alter the file hash. Created attachment 352904 [details] PNG run through zopflipng Here's a png run through zopflipng https://github.com/google/zopfli I have all the pngs with this locally and am happy to make a patch. Please confirm that it works and I'll make a patch for it all. Hi Don, I can confirm that libpng no longer produces the error. As I mentioned above, using "pngcrush -ow -fix" removes the bad chunk without recompressing the image data, so using that would be even better. Created attachment 353048 [details]
Patch
Runs all pngs through zopflipng.
I'm guessing the ruby errors in the review patch might be due to this original issue. Created attachment 353049 [details]
Patch
Comment on attachment 353049 [details]
Patch
Forgot a folder...
Comment on attachment 353049 [details]
Patch
r=me, Looks good on my Mac and the file sizes are dramatically better.
However this misses a few of the pngs that were called out in the bug description. Namely the ones in:
Source/WebCore/Resources/*.png
This should modify resources like textAreaResizeCorner.png.
(In reply to Joseph Pecoraro from comment #13) > Comment on attachment 353049 [details] > Patch > > r=me, Looks good on my Mac and the file sizes are dramatically better. > > However this misses a few of the pngs that were called out in the bug > description. Namely the ones in: > > Source/WebCore/Resources/*.png > > This should modify resources like textAreaResizeCorner.png. Yea since I'm here I'll just make a script that runs through inside Source but not in Source/ThirdParty and compresses it. For future issue, same might apply to PNG data embedded in CSS files. $ find -print0 -path '*.css' | xargs -0 grep "data:image/png" bump. Don, are you able to put up another updated patch, or maybe you'll return to this after your other upstreaming work? (In reply to Joseph Pecoraro from comment #17) > Don, are you able to put up another updated patch, or maybe you'll return to > this after your other upstreaming work? Yea I'll get that going after I'm done with a couple patches I have in the pipe. bump. Created attachment 354526 [details]
Patch
Comment on attachment 354526 [details]
Patch
This runs through everything. If I went too far with it let me know Joe.
Comment on attachment 354526 [details]
Patch
r=me
Comment on attachment 354526 [details] Patch Clearing flags on attachment: 354526 Committed r238106: <https://trac.webkit.org/changeset/238106> All reviewed patches have been landed. Closing bug. Thanks for fixing. |