When run command php bin/magento catalog:image:resize
, it stops after few images and shows error.
How fix this?
I tried manually reupload images to this folder after this problem.
Peter,
It seems you are missing swatch image place holder.
Either upload it from the backend or upload manually to below file path
/home/public_html/vendor/magento/module-catalog/view/base/web/images/product/placeholder
name should be swatch_image.jpg only.
I'm experiencing the same problem and I can confirm that the script is prepending [webroot]/pub/media/ to the path of the image it wants to resize and therefore can't find it.
Thus, it's not a solution to add an image to that path since the path does not exist.
Anyway, you can still just ignore the error and skip the batch resizing. The result will be the same as after emptying the image cache from the admin interface.
In consequence, resized images will be generated on demand for each product when the product (detail page) is viewed by a frontend user for the first time. This will slow down performance for the first impression of each product's detail page. Apart from that, there should not be any negative consequences.
I noticed the path in my error message looks strange and yours looks the same with slightly different folder names.
File '/var/www/magento/pub/media/var/www/magento/vendor/magento/module-catalog/view/base/web/images/product/placeholder/swatch_image.jpg' does not exist.
The second half of that path is real and the image is there:
var/www/magento/vendor/magento/module-catalog/view/base/web/images/product/placeholder/swatch_image.jpg
However the error implies that it's prepending that location with var/www/magento/pub/media/
Is that intentionally like that or is this problem related to where it's looking for the image?
Please Read
https://devdocs.magento.com/guides/v2.2/release-notes/ReleaseNotes2.2.6CE.html
The catalog:image:resize command execution time has been reduced by up to 90% in the release. However, this improvement necessitates these additional steps after upgrading your Magento instance to 2.2.6:
Remove pub/media/catalog/product/cache . (Removing this folder frees up space.)
Run bin/magento catalog:image:resize to generate a new image cache. (This step is necessary because we’ve changed the path to cached images and must remove the previously cached images.)
Some Images could not be resized. See log file for details
Example:
5781-R101.png do not work ABCDEFG.jpg work
08985-AA01.jpg do not work ABCDEFH.jpg work
I did not change much on picture only name changes
I fixed it by uploading the placeholder images in the backend. https://docs.magento.com/user-guide/catalog/product-image-placeholders.html
The cause of the problem maybe was that we recently moved the site to a new server with new paths.
vendor/magento/module-catalog/view/base/web/images/product/placeholder