I have a news blog created on WordPress. I've set up WordPress to create 3 resized versions of images when uploading them.
315x215(featured image with cropping option enabled)
620x (to create images by width and set up height automatically depending on image)
900x (the same, but larger for gallery)
original image(it is being saved automatically)
When I uploaded some images Ive noticed that WordPress creates
300x250 or 216...,
315x215
620x
900x images (and of course original)
WHY does WordPress create 300x size image??? Recently I removed 900x image option because I don't use it anymore, and after that WordPress does the same but instead of making unused 315x image now it creates additional image of 620 width which is being cropped by height (for example, normal 620x396 and cropped 620x350). Now the 315x images are generated without unused 300x, but the same problem is with 620x. Using WordPress 3.5.1 (but the problem was from the start- 3.4).
Update:
I am using this code in functions.php
add_theme_support('post-thumbnails');
set_post_thumbnail_size(315, 215, true);
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10, 3 );
function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) {
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
return $html;
}
I've set up WordPress to create 3 resized versions of images by going to Media Options and pointing 315x215 in featured image options and checked Crop featured image option, 620x0 for medium size and 900x0 for large size(the last one 0x0 now, I just don't need it anymore)
Update 2:
Sorry Michael, but You didn't understand. I WANT WordPress to automatically generate different sizes of images(315x215 for thumbnails 620x for medium size images). I have adjusted the sizes in Dashboard -> Settings -> Media -> Image Sizes like that. What I DON'T want WordPress to do is to generate two images with width 620px and different heights (often or always it is 620x350 and 620x348). It's some kind of bug or something I think, an intermediate image left by WordPress after generating sizes. Will really appreciate if someone helps.
add_image_size()
.