PNG containing large zTXt chunk not displayed in Firefox but in other programs
Categories
(Core :: Graphics: ImageLib, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: jexler, Assigned: aosmond)
References
()
Details
(5 keywords)
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15
Steps to reproduce:
Open https://www.artecat.ch/jexler/moebius/moebius.png in Firefox 65.0.1 (observed on Mac OS X 10.12.6 "Sierra")
Actual results:
Firefox shows a black background with text "The image "https://www.artecat.ch/jexler/moebius/moebius.png" cannot be displayed because it contains errors."
Expected results:
The PNG opens fine in Chrome and Safari, as well as in Photoshop and Gimp etc.
The PNG contains an rather unusually large 5 MB zTXt chunk, which is likely the immediate cause of the error in Firefox (removing all "metadata" chunks from the PNG results in a PNG of 2.8 MB size that is displayed correctly in Firefox, see https://www.artecat.ch/jexler/moebius/moebius2.png ).
The images were produced by converting a PDF to PNG using ImageMagick, see https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=35541
It is not 100% sure at the moment that the PNG is formally correct, but since all other applications tested could display (and/or edit) it, the Firefox behavior is likely not desireable: If an image displays correctly in most places it should ideally rather not fail in just one web browser, else creating web pages is made harder...
Is there a way to get more information behind the error in Firefox? It the error maybe a security measure that limits the size of certain chunks in a PNG to prevent attacks on the browser with images with huge such chunks?
![]() |
||
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
20190224092357
Comment 2•5 years ago
|
||
Caused by bug 1402057.
Indeed, the 5mb chunk hits the 4000000 limit we have on not idat/fdat chunks.
Chrome patches libpng to work around this.
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
(In reply to Timothy Nikkel (:tnikkel) from comment #2)
Caused by bug 1402057.
Indeed, the 5mb chunk hits the 4000000 limit we have on not idat/fdat chunks.
Chrome patches libpng to work around this.
Do we really need to patch the library? It is configurable, and we could just set it to something larger.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
Pushed by aosmond@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/6b78699bdf7b Allow libpng to allocate larger chunks for decoding purposes. r=tnikkel
Comment 6•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•