I'm currently trying to run the image resize command in the CLI for Magento2.3.2 but it keeps coming up with the following error as soon as I run the command:

mysite@dx1287:~/httpdocs$ php bin/magento catalog:images:resize

I get the error:

Warning: imagecreatefrompng(): gd-png: fatal libpng error: Read Error: truncated data  in /var/www/vhosts/mysite.com/httpdocs/vendor/magento/framework/Image/Adapter/Gd2.php on line 72

Does anyone now why this is happening and what I can do to fix it?

1 Answer 1


This error might occurred due to an unsupported file format or bad quality of PNG image. imagepng should have a valid quality format between 1 and 9.

Check the var/log directory for the corrupted catalog image, then remove the corrupted image & re-add the updated image. Hopefully it will fix your issue!

  • Thank you. Which log file is this likely to be found in?
    – CJNotts
    Feb 24, 2020 at 13:03
  • Check exception.log or debug.log file for reference hints. Feb 25, 2020 at 5:45
  • Thank you. I'll check these.
    – CJNotts
    Feb 25, 2020 at 9:18
  • Hi. I'm afraid that neither of these logs contain an error relating to an image file.
    – CJNotts
    Feb 25, 2020 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.