0

I have 2 additional image sizes i've added to my theme and the for some reason when I use the Force Regenerate Thumbnails plugin, my images are created but the files sizes are not exact.

Here is the setting I have in my function.php file.

 add_theme_support( 'post-thumbnails' );

 add_image_size( 'cmntouch_featured', 450, 300, true );
 add_image_size( 'cmntouch_tile', 150, 150, true );

So the images that are regenerated should look like this:

img1_150x150.jpg img1_450x300.jpg

Some of them are generated correctly but about 25% come back with images that are totally off like this:

Future-of-webdesign-New-york-450x144.png Future-of-webdesign-New-york-150x144.png Aladdin-450x127.jpg Calvant-450x160.jpg

Has anyone see this issue when creating additional image sizes?

1 Answer 1

1

I think that's what is supposed to happen in Hard crop mode. If you resize an image to 450px wide and the height becomes proportionately smaller than the cropped height value you give for your image size, then you get the smaller height value. It's not going to stretch the height and distort your image, I think that would be way worse.

You could try changing the $crop parameter to false, and see if you like the results better.

1
  • Well the actual size of the image doesn't matter as long as its close. I am only concerned about the file name. I have a function that finds the first image in a post and then applies that image as the featured image on the homepage. Unfortunately the image name isn't consistent, so I get a bunch of broken images on the homepage. Do you have a solution for checking for the first image and then looking for the specified image(ie; the first image is img1.jpg and I want to pull img1_150x150.jpg). Commented Sep 14, 2012 at 22:53

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.