Wrong File Error Resize Image Magento 2.3
-
10-04-2021 - |
Question
I just migrated from Magento 1.9.3.8
to Magento 2.3.4
, then i copied the image from Magento 1.9
media to Magento 2 media, i noticed product images still not showing in my Magento 2 frontend, then i run:
php bin/magento catalog:images:resize
Wrong file
libpng warning: iCCP: known incorrect sRGB profile
I already clean the cache , delete the cache file , reindex, but still same error
Updated
i've fixed the libpng error by running, but the wrong file error still exists
find pub/media -type f -iname '*.png' -exec pngcrush -ow -rem allb -reduce {} \;
When i look up the file that causes this error, turns out the file does not exist
La solution
I don't think it's related to migration in general, but to how your original images are generated Try solution here it should work for you
As for Wrong file exception, it's thrown in
vendor/magento/framework/Image/Adapter/Gd2.php:64
if (!$filename || filesize($filename) === 0) {
throw new \InvalidArgumentException('Wrong file');
}
So I suggest you check that the actual file is not empty