Skip to content

Image is failing to read because IDAT: chunk data is too large #747

Closed

Description

@danpetitt
  • [YES] I have written a descriptive issue title
  • [YES] I have verified that I am using the latest version of ImageMagick
  • [YES ] I have searched open and closed issues to ensure it has not already been reported

Description

I try and read the image below and i get an "because IDAT: chunk data is too large" error message:

testimage

Earlier version (v7.0.6.102 specifically) of ImageMagick worked fine, I upgraded to v7.07 and now it doesn't.

The image opens in all image editors fine.

If I open the image in paint.net and save it back out in same format and using Auto-Depth settings, the size reduces from 65kb to 4kb and ImageMagick then has no problems reading it.

Steps to Reproduce

var readSettings = new MagickReadSettings();
readSettings.Format = MagickFormat.Png;

using( var downloadStream = new FileStream( "TestImage.png", FileMode.Open ) )
using( var resizedImageStream = new MemoryStream() )
using( var image = new MagickImage( downloadStream, readSettings ) )  // exception thrown here
{
    image.Strip();                // Strip out all profile info...
    image.Quality = 100;

    image.Write( resizedImageStream, readSettings.Format );
    resizedImageStream.Position = 0;

    // we do something with the memory stream....
}

Stack trace:

Source: Magick.NET-Q16-x64
IDAT: chunk data is too large `' @ error/png.c/MagickPNGErrorHandler/1711
   at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result)
   at ImageMagick.MagickImage.NativeMagickImage.ReadStream(MagickSettings settings, ReadWriteStreamDelegate reader, SeekStreamDelegate seeker, TellStreamDelegate teller)
   at ImageMagick.MagickImage.Read(Stream stream, MagickReadSettings readSettings, Boolean ping)
   at ImageMagick.MagickImage..ctor(Stream stream, MagickReadSettings readSettings)

System Configuration

Windows 10 Visual Studio 2017, but also on Windows Server multiple versions

  • ImageMagick version: Magick.NET-Q16-x64 v7.07
  • Environment (Operating system, version and so on): Windows (any)
  • Additional information: none not already mentioned above

Activity

  1. dlemstra commented on Sep 11, 2017

    @dlemstra
    Member

    You are positing the message in the wrong project. Can you open an issue here instead: https://github.com/dlemstra/Magick.NET/issues? Feel free to use the same template 👍

  2. glennrp commented on Sep 11, 2017

    @glennrp
    Contributor
  3. dlemstra commented on Sep 11, 2017

    @dlemstra
    Member

    @glennrp When are you planning to release 1.6.33?

  4. glennrp commented on Sep 11, 2017

    @glennrp
    Contributor

    Hopefully on Sept 28, but I've got some oss-fuzz issues that I'd like to resolve first. oss-fuzz turnaround is slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions