question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImageMagick.MagickCoderErrorException : 'IDAT: CRC error `' @ error/png.c/MagickPNGErrorHandler/1715'

See original GitHub issue

Prerequisites / Description

Hi !

Everytime I run the following code on the specified PNG image I get “ImageMagick.MagickCoderErrorException : ‘IDAT: CRC error `’ @ error/png.c/MagickPNGErrorHandler/1715’”.

I searched for this issue in this repository, on GitHub, on StackOverflow and everywhere on Google but I can’t find anything useful regarding “ImageMagick.MagickCoderErrorException”, “IDAT: CRC error” nor “error/png.c/MagickPNGErrorHandler/1715”, so I post it here.

Steps to Reproduce

using ImageMagick;
using System.Net;

namespace MagickCRCError
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            byte[] data;
            using (WebClient client = new WebClient())
            {
                data = client.DownloadData("https://www.muenzeoesterreich.at/var/em_plain_site/storage/images/_aliases/product_full/media/bilder/produktbilder/2.sammeln/2.2.5_euro/5e_2018_osterhase_set/3970854-2-ger-DE/5e_2018_osterhase_set.png");
            }

            MagickImage image = new MagickImage(data);
            image.BackgroundColor = MagickColors.White;
        }
    }
}

System Configuration

  • Magick.Net version : 7.15.0
  • .Net version : Core 3.0
  • OS version : Windows 10 1909 x64 (18363.592)

It’s probably an issue from the PNG itself (CRC Error) but I can open it in any web browser or image viewer so it’s a bit weird to me. Feel free to close this issue if I have missed something.

Anyway, thanks for developing Magick.Net !

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dlemstracommented, Jan 22, 2020

The ImageMagick library that is being used by Magick.NET is very strict about the PNG file being valid. And it appears that your file is not valid. There is an option to disable CRC checking and I should add that to the PngReadDefines but I tried that on the command line and it then still fails to read the file. Other programs can read the image because they are less strict about the contents of the file and probably ignore a lot of information that is still being read by ImageMagick.

0reactions
dlemstracommented, Dec 1, 2020

Could you create a new issue @Wabbbit and explain in more detail (with a test image) the issue that you are experiencing?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hang file and error INFECTED PNG files - Magick
I have some INFECTED PNG samples which image magick failed to convert. ... Code: Select all convert.exe: IDAT: CRC error `O:\infile.png' ...
Read more >
Exception creating and saving an image multiple times with ...
Update: It seems the actual problem is I have a preview pane that contains a background image of the image that gets saved....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found