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.

  • your issue resolved if yes then mention steps here – imtiazau Aug 19 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 – Dava Gordon Aug 19 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? – CJNotts Aug 19 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 – Dava Gordon Aug 19 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. – CJNotts Aug 20 at 9:29
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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