PNG image with invalid chunk type is not loaded in Firefox. Chrome ignores error and displays image
Categories
(Core :: Graphics: ImageLib, defect)
Tracking
()
People
(Reporter: kbrosnan, Unassigned)
References
Details
Attachments
(1 file)
37.06 KB,
image/png
|
Details |
From github: https://github.com/mozilla-mobile/fenix/issues/18008.
Steps to reproduce
- Download attachment image
- Install and enable Wifi File Transfer
- Input the IP location given by Wifi File Transfer
- Find the downloaded image
- Open with Firefox
Expected behavior
The image should be display without any problem
Actual behavior
After the image is opened, the image is displayed on screen, suddenly it was replaced by a text
http://192.168.1.103:1234/storage/emulated/0/Download/250px-Coreldraw_x8.png
on grey background.Device information
- Device vendor / model and Android version: Galaxy S6, Android 7
- Firefox for Android version: 85.1.3
Attachment
Change performed by the Move to Bugzilla add-on.
Reporter | ||
Comment 1•4 years ago
|
||
Running pngcheck against the image outputs
.\108021044-adc90f00-7058-11eb-8567-c4822f985e79.png CRC error in chunk tEXt (computed f237937e, expected 61775f78)
ERROR: ..\108021044-adc90f00-7058-11eb-8567-c4822f985e79.png
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 3•4 years ago
|
||
Oh the Move to Bugzilla extension truncated that section. Sure
Comment 4•4 years ago
|
||
From bug 1225679, comment 5 Chrome seems to ignore crc failures in IDAT (image data) chunks, IE ignored crc failures in IHDR and IDAT chunks. Ignoring the crc for text chunks seems reasonable since we don't use those chunks at all.
Comment 5•4 years ago
|
||
Oh, but that's actually not what's causing us to fail, that only causes a warning. With PNGDecoder:5 for mozlog:
E/PNGDecoder libpng error: g[BD][35][81]: invalid chunk type
Comment 6•4 years ago
|
||
And if you -f force pngcheck to continue you get
invalid chunk name "g?5?" (67 ffffffbd 35 ffffff81)
chunk g?5? at offset 0x092a3, length 942567534: EOF while reading data
Updated•4 years ago
|
Comment 7•4 years ago
|
||
Our png decoder works something like like "decode until the end of all the data then complete". For it to accept this file we would need to change it to "did we decode the image data expected based on the header, then stop reading", which is not trivial (probably not a huge refactoring, but not trivial).
Updated•4 years ago
|
Updated•3 years ago
|
Description
•