GIMP created png with bad iCCP checksum from thumbnail
GIMP version: 2.10.4
Operating System: macOS High Sierra 10.13.6 (17G65)
Package: download from gimp.org
Description of the bug
I edited an image in GIMP and exported as a png. The file worked in Chrome and Mac Preview, but failed in the Python Pillow library. The file continued to fail after re-exporting or making minor changes and re-exporting. Other files I save from GIMP work fine so this is a strange one-off problem.
Please describe your issue with details. Add screenshot or other files if needed.
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- Load the attached file.
- Re-export as png.
- Try to read in Python with PIL library
>>> from PIL import Image
>>> Image.open('mosfet-bad.png')
Expected result: File can be read with PIL
Actual result: File is corrupt and rejected by Pillow library with "IOError: cannot identify image file 'mosfet-bad.png'"
Additional information
I opened a bug against Pillow here. They determined that the png file was corrupt and put more information in that bug report. In particular, they found a bad checksum in the iCCP header. That bug shows other tools that reject the file.
After testing various options, I determined that the problem happens only with the "Save thumbnail" option under "Export Image as PNG" / Advanced. I don't know the connection between iCCP and the thumbnail.