0
votes

I have a Wordpress site with more than 1000 product images. I recently added 2 custom image sizes, product-medium and product-large. So, when I upload a new product featured image, it is hard cropping the medium and large sizes perfectly.

However, the already uploaded images don't crop themselves to these 2 sizes. Any suggestions would be helpful.

I have tried using the regenerating thumbnails plugin, but it doesn't generate the 2 custom image sizes.

add_image_size( 'product-medium', 640, 480, true );
add_image_size( 'product-large', 1024, 576, true );

There is no error message. All the newly uploaded images show the 2 custom resolutions but the older ones don't.

1
Obviously the image sizing is done as part of the Upload processing. You are going to have to find a way of cropping existing (already uploaded) images. Maybe you will have to write something yourselfRiggsFolly
Are your images smaller than those sizes? Do you have other custom sizes that are close to those? If you've already tried the regenerate thumbnails plugin, this may be the issue.disinfor
disinfor@ Almost 80 percent of my images have 1080x1080 resolution and no I don't have any other custom sizes closer to those. I am currently using the regenerate thumbnail plugin. but it is generating a red x in front of both the sizes and a green tick mark in front of all the other sizes.Dev B

1 Answers

0
votes

You need to regenrate the thumbnails for the existing uploaded theme. You can also use wp-cli command to do the same :

wp media regenerate

You can also do the same with the plugins available in WordPress repository.

It will re-create the images with existing image sizes.