0

I have a program which processes images with imagick in PHP:

$image = new \Imagick();
$image->readImageBlob($fileSystem->read($file));

This process raises an error on CRC errors:

IDAT: CRC error `' @ error/png.c/MagickPNGErrorHandler/1643

There is nothing wrong with this image and I want to process it just like the rest of them, I don't care that the CRC check fails.

DeniseMeander
  • 806
  • 2
  • 9
  • 28
  • 1
    How exactly are you using imagick (show code!), and is this error actually an exception? If so, catch it - https://stackoverflow.com/questions/15887228/how-to-know-if-imagick-throws-an-error-php – misorude Dec 06 '18 at 13:01
  • 1
    How can we reproduce this? Please add your PHP code – Daniel W. Dec 06 '18 at 13:01
  • I updated the question with the code where I create the imagick image. I do catch the errors but I cannot proceed with this image once it failed loading into imagick. I would like to tell imagick not tho check the file hash. There are image manipulation programs which do not update this hash and all of those files are then 'corrupt'. – DeniseMeander Dec 06 '18 at 13:08
  • To reproduce you need a 'corrupt' image file, i don't think I can upload one here. – DeniseMeander Dec 06 '18 at 13:09
  • 1
    "there is nothing wrong with this image": well, the CRC is wrong. But if you can open it in another program, you could save it there and hopefully create a correct header. Is this only one file where you have this problem, so a manual solution would be acceptable? – Karsten Koop Dec 06 '18 at 13:20
  • It is a program which processed large amount of files daily, so fixing every image by hand is no solution. I can imagine that there could be files which are indeed corrupt who fail this CRC check, but while randomly checking these corrupt files I came across none. – DeniseMeander Dec 06 '18 at 13:31

0 Answers0