Imagesharp: "CRC Error. PNG Image chunk is corrupt!" when loading certain image

Created on 9 Aug 2017  路  7Comments  路  Source: SixLabors/ImageSharp

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have verified that I am running the latest version of ImageSharp
  • [X] I have verified if the problem exist in both DEBUG and RELEASE mode
  • [X] I have searched open and closed issues to ensure it has not already been reported

Description

When loading the image below I run into an issue that ImageSharp says that the PNG Image chunk is corrupt.

versioning-1_1.zip
versioning-1_1

Steps to Reproduce

Simply load it using Image.Load();

// Loads the image
Image.Load(imagePath);

System Configuration

  • ImageSharp version: 1.0.0-alpha9-00176
  • Other ImageSharp packages and versions: -
  • Environment (Operating system, version and so on): Windows 10
  • .NET Framework version: .NET Core
  • Additional information: -

Most helpful comment

Thanks for fixing all these issues so quickly guys :smile:

All 7 comments

I get the following error with ImageMagick:

identify: zTXt: CRC error 'versioning-1_1.png' @ warning/png.c/MagickPNGWarningHandler/1709.

Maybe this will help someone solve the issue. It looks like the image chunk is not corrupt.

What's that error telling me?

In ImageMagick we just report a warning when the CRC of the zTXt is incorrect. I just did a quick check of our decoder and we report corrupt Image Chunk for every chunk. I thought this was an exception for an invalid IDAT chunk. I wonder if we should only throw an exception when the CRC of a critical chunk is invalid? Maybe we could also include the name of the chunk in the exception?

Is this issue related to #276?

Most likely. We should double check the PR against all given images in both issues

Ah, I apparently didn't look good enough in the open issues. My apologies.

Thanks for fixing all these issues so quickly guys :smile:

Was this page helpful?
0 / 5 - 0 ratings