Cannot load png: Incorrect bKGD chunk length
Posted: 2014-03-13T07:17:20-07:00
Hi,
We're using ImageMagick through its C++ interface in our project. We're trying to load a png image by calling Magick::Image::read with a Magick::Blob argument and get a Magick::Warning exception that says:
The image we're trying to load is here: https://www.dropbox.com/s/g6dro4hpu4v6igk/bad.png
As I understand, the image may not be completely valid, but all viewers I tried display it correctly (I tried Okular and Chrome), although Okular also displays the libpng warning on the console. The image was produced by MS Paint by loading an image with alpha channel, editing it and saving without the alpha channel.
I tried to set the warning handler by calling MagickCore::SetWarningHandler prior to loading the image but it doesn't have any effect (my handler does not get called). Basically, I cannot ignore this warning and get this image loaded.
Is it possible to make this warning non-fatal and load this image even with it?
We're using ImageMagick 6.8.7-7 and 6.8.8-8 on Debian Squeeze/Wheezy and Kubuntu 13.10 x86_64.
We're using ImageMagick through its C++ interface in our project. We're trying to load a png image by calling Magick::Image::read with a Magick::Blob argument and get a Magick::Warning exception that says:
Code: Select all
Incorrect bKGD chunk length `' @ warning/png.c/MagickPNGWarningHandler/1830
As I understand, the image may not be completely valid, but all viewers I tried display it correctly (I tried Okular and Chrome), although Okular also displays the libpng warning on the console. The image was produced by MS Paint by loading an image with alpha channel, editing it and saving without the alpha channel.
I tried to set the warning handler by calling MagickCore::SetWarningHandler prior to loading the image but it doesn't have any effect (my handler does not get called). Basically, I cannot ignore this warning and get this image loaded.
Is it possible to make this warning non-fatal and load this image even with it?
We're using ImageMagick 6.8.7-7 and 6.8.8-8 on Debian Squeeze/Wheezy and Kubuntu 13.10 x86_64.