Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

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.

share|improve this answer
    
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). –  CNCPTS Sep 14 '12 at 22:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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