Can images be automatically compressed?

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

Related posts

Leave a Reply

4 comments

  1. 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)

  2. 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.