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.

having trouble educating clients to compress their images, and would quite like wordpress to compress images to predefined size (normally, 800px long edge, 72dpi) and discard the original

share|improve this question
1  
Some related discussion on this question Decrease image size –  Rarst Oct 22 '10 at 10:04
add comment

4 Answers

up vote 1 down vote accepted

Use http://wordpress.org/extend/plugins/auto-image-resizer/

Add this to your functions.php:

function prune_image_sizes($sizes) {
// You can add other size like that for remove those sizes
//  unset($sizes['medium']);
    unset($sizes['large']);

    return $sizes;
}
add_filter('intermediate_image_sizes_advanced', 'prune_image_sizes');

Set your large image option to 800px in media options panel.

So what did you do? System will not create large size of image but will reduce original image size to large size ( 800px ) option. Most of developer dont like it but when client have to upload lots of image and dont have hosting space so much, this will helps.
(Sorry for my english)

share|improve this answer
add comment

I think if you set the $content_width global variable (in your theme's functions.php for example), all images will be resized to be no wider than that. Remember to also change the settings for the large image size, otherwise it will be confusing to users why they can't use that size anymore.

share|improve this answer
    
I think that unless you override it somewhere, WordPress will try to define the "large" image size to the value you set in $content_width (and then correspondingly set the "medium" and "small" sizes proportionally)... –  goldenapples Oct 26 '10 at 17:54
add comment

If your concern is about discarding the original images to conserve space. I think you might have to hook the 'add_attachment' action to delete the original after resizing. In combination with Jan's suggestion about setting your $content_width variable to your maximum size, this should do the trick.

share|improve this answer
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.