0
votes

I upload images around 500x500kb (vary slightly as I resize with a percentage). Wordpress is set to create thumbnails at 150x150.

However, I'm getting 'serve scaled images' errors for two file sizes (dimensions added to end of file title) that are begin resized. One is 272 x 148 and the other is 160x160, yet these sizes aren't in Wordpress media settings. I'm guessing they are theme-specific.

But, as these files appear to be created automatically, how do I set it up so that files are created with the dimensions that are obviously needed by my theme.

And, how does my theme know which version to grab?

Thanks!

1
You're most probably right in that this will be theme specific. Likely there's some CSS at play which is resizing the images on render. Try viewing the source URL of the image in a browser to confirm the 'real' dimensions - henrywright
Hey Henry, I've got the source and the resized dimensions. Have already resized the images that were 160x160 (original) down to the 80 x 80 that they are generated at. Just don't know what to do now. How does the CSS know for the 80 x 80 images which image this is? Obviously there's a problem somewhere if the 80x80 size images aren't being created automatically. - user3161856
Do you have access to your server? Try going to wp-content/uploads/ to take a look at the files that are being generated. That's where all of your images are saved. - henrywright

1 Answers

0
votes

Adding new image size

You are looking for Wordpress add_image_size function.

Registers a new image size. This means WordPress will create a copy of the image with the specified dimensions when a new image is uploaded.

In your case:

add_image_size('your-custom-size-name', 272, 148, true);

More info on codex: http://codex.wordpress.org/Function_Reference/add_image_size

New image size in theme

Your theme grabs the image size you ask for with the function get_post_image_thumbnail.

get_the_post_thumbnail($post_id, 'your-custom-size-name');

Resizing existing images

If you've already uploaded some images, you may want to adjust them to the new dimensions automatically. There are few plugins that do so, for example Regenerate thumbnails.


Also, you may want to look to all-in-one tutorial on TutsPlus I've found while googling for the plugin.