Skip to content

diff PNG is missing IEND chunk/invalid CRC checksum #109

@jochen-testingbot

Description

@jochen-testingbot

Hi,

When using odiff 3.1.1 or lower, a PNG file is correctly generated showcasing the diff between two images:

./node_modules/.bin/odiff one.png two.png --diff-mask diff.png

However, the diff.png seems to be slightly corrupted. When I try to convert it to for example jpg, ImageMagick will complain:

convert diff.png diff.jpg

convert: Expected 8 bytes; found 0 bytes `diff.png' @ warning/png.c/MagickPNGWarningHandler/1526.
convert: Read Exception `diff.png' @ error/png.c/MagickPNGErrorHandler/1492.
convert: no images defined `diff.jpg' @ error/deprecate.c/ConvertImageCommand/3368.

The PNG shows up fine in my Chrome browser or on macOS.
When I try to inspect/repair through https://compress-or-die.com/repair it will repair the image and I can use it with ImageMagick.
The output from this is:

Added missing IEND chunk. Probably the image file was truncated and the IDAT chunk could also be incomplete.
--
Combined all IDAT chunks.
Fixed CRC checksum for chunk "IDAT".
Fixed CRC checksum for chunk "IEND".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions