I am writing a theme which uses different image sizes.
Here are my targeted sizes as they are set up in under Settings > Media in WP Admin:
Here is the functions.php code for the thumbnail support:
$THUMBNAIL_SIZE = 320;
$MEDIUM_SIZE = 460;
$LARGE_SIZE = 1366;
if (function_exists('add_theme_support')) {
add_theme_support('post-thumbnails');
set_post_thumbnail_size( $THUMBNAIL_SIZE, 9999);
add_image_size( 'medium-size', $MEDIUM_SIZE, 9999 );
add_image_size( 'large-size', $LARGE_SIZE, 9999 );
}
So, as you can see, the sizes are 320px wide, 460px wide and 1366px wide.
The problem is, when I upload a 1366px wide image it uploads the original file and additionally creates 320px, 460px and 1366px resized images.
E.g.
UPLOAD:
- someimage.jpg (which is 1366px wide)
OUTPUT (in /uploads/2015/08/)
someimage.jpg
someimage-1366x937.jpg
someimage-460x316.jpg
someimage-320x220.jpg
What I can see is that the autocreated someimage-1366x937.jpg is compressed, which I am not really anticipating.
In my previous experience if the uploaded image had the same size as the largest specified size, it did not create a duplicate.
I don't need these duplicated images with the same width as the original upload, they are just wasting storage space.
I am using Wordpress 4.3. No plugins are added yet, so it's definitely something that is the Wordpress core is doing, I haven't experienced this before updating version 4.3 (I used a version 4.0 before and picked up developing WP again after 4.3 came out.
UPDATE:
Here is my image editing process.
I always resize the image to the largest size needed. Some posts need 1366px wide images, some only need a 460px wide image.
Whatever scenario applies, I want Wordpress to take the image I upload and not to recreate a compressed duplicate of it. Additionally, it has to create all the smaller sizes.
This means:
1366px upload --> create 460px and 320px
460px upload ---> create 320px