15

When run command php bin/magento catalog:image:resize, it stops after few images and shows error.

How fix this?

enter image description here

I tried manually reupload images to this folder after this problem.

enter image description here

7
  • Check file/folder permission at vendor/magento/module-catalog/view/base/web/images/product/placeholder
    – Amit Bera
    Sep 19, 2018 at 9:24
  • I tried change folder placeholder permission 755 to 777 but it is same problem.
    – Peter
    Sep 19, 2018 at 10:02
  • have you fix this error? if yes please add solution. I have same issue. Nov 2, 2018 at 19:08
  • What is the solution for this? Even i am facing the same problem
    – Nafsss
    Jun 25, 2019 at 7:52
  • i am facing same issue,is there any way to solve this? May 13, 2020 at 7:39

6 Answers 6

3

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.

1
  • You are reading my message? "I tried manually reupload images to this folder after this problem." Check second image.
    – Peter
    Sep 20, 2018 at 8:12
2

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.

2

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?

2
  • have you got any solution? Nov 2, 2018 at 19:14
  • 2
    how is this an answer?
    – Andy
    Jan 25, 2019 at 13:41
1

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.)

4
  • I tried remove folder cache and var content but still same issue.
    – Peter
    Sep 19, 2018 at 10:31
  • I solved issue removing placeholder folder content files swatch_image.jpg, image.jpg, small_image.jpg and thumbnail.jpg. When restore back to placeholder content files it show same error. But problem is still why it show error for placeholder content files?
    – Peter
    Sep 20, 2018 at 9:42
  • Because such condition are there in to code that's why.
    – Pratik
    Sep 20, 2018 at 14:03
  • it's not working still. Dec 5, 2019 at 6:39
1

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

0

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.

Your Answer

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

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