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 hereimtiazau– imtiazau2019年08月19日 09:43:26 +00:00Commented 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 9Dava Gordon– Dava Gordon2019年08月19日 10:26:38 +00:00Commented 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?CJNotts– CJNotts2019年08月19日 11:16:51 +00:00Commented 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 editorDava Gordon– Dava Gordon2019年08月19日 12:30:58 +00:00Commented 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.CJNotts– CJNotts2019年08月20日 09:29:47 +00:00Commented Aug 20, 2019 at 9:29
1 Answer 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
Explore related questions
See similar questions with these tags.