0

I'm currently trying to run the following command

php bin/magento catalog:images:resize

But when it gets part way through I get the following error:

587/1490 [>] 39% 9 mins 54.0 MiB | /d/o/download_6_.pngWarning: imagecreatefrompng(): gd-png: fatal libpng error: Read Error: truncated data in /var/www/vhosts/mywebsite.com/httpdocs/vendor/magento/framework/Image/Adapter/Gd2.php on line 72

I've looked into the file in question and this seems to be the piece of code around line 72.

$this->_imageHandler = call_user_func(
 $this->_getCallback('create', null, sprintf('Unsupported image format. File: %s', $this->_fileName)),
 $this->_fileName
 );

I'm not sure what I need to to to correct this issue. I'd appreciate any advice on how to resolve this.

asked Aug 19, 2019 at 9:04
8
  • your issue resolved if yes then mention steps here Commented Aug 19, 2019 at 9:43
  • From whati can see the reason for this error is down to an unsupported file format or the quality for the imagepng does not have a valid quality format it needs to be between 1 and 9 Commented Aug 19, 2019 at 10:26
  • @DavaGordon Thanks. Would I be correct in assuming that removing the image file or giving it a quality format would resolve the issue? Commented Aug 19, 2019 at 11:16
  • Removing would b the best option I very much doubt its a quality issue but I'd try removing and readding after resaving in an image editor Commented Aug 19, 2019 at 12:30
  • @DavaGordon Hi again, I'm afraid that this hasn't worked. I've deleted the file and replaced it several times but I still keep getting the same error. Am I correct in thinking that it's the"download_6_.png" that's causing the issue as I have ensured that it is no longer connected to the product. Commented Aug 20, 2019 at 9:29

1 Answer 1

1

From what i can see the reason for this error is down to an unsupported file format or the quality for the imagepng does not have a valid quality format it needs to be between 1 and 9. you will need to remove the affected image and edit and resave the image using an image editing tool such as photoshop or gimp

answered Aug 20, 2019 at 10:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.