Site logo

Archived topic

Automatically Generated Images

3 replies · Started by Janine on December 28, 2019

Viewing posts 1–4 of 4

Hi.

When I upload an image, does GP automatically generate any image sizes?

I did a search in my functions.php file for add_image_size and set_post_thumbnail_size. I see no entry for it.

But I did notice this:

/*Create 365x243 feature images*/
add_filter( 'generate_page_header_default_size', 'tu_smaller_column_images' );
function tu_smaller_column_images( $size ) {
// Set up our conditional
if ( ! is_singular() && ! in_array( 'featured-column', get_post_class() ) ) {
return 'medium';
}

return $size;
}

Can you tell what this means?

I ask because right now in Settings > Media, I have everything set to 0. But when I upload an image file (900x600, 16KB), WP is still generating an additional image file that is 768x512 and 70KB. In other words, much larger.

https://drive.google.com/file/d/15x7LUUBouo0jWxyt9DK4X-YCTDpBe9CD/view?usp=sharing

Thank you.

P.S. I am doing these tests on a staging site of my live site!

Hi there,

That function is telling GP to use the "medium" image size for your featured images. It doesn't create a new size, it's just telling it to use an existing size. That's a custom function you've likely added at some point.

GP itself doesn't create any image sizes unless your blog image size options are set in "Customize > Layout > Blog".

Those sizes you're seeing are created by WordPress to use in srcset. You should be able to disable it: https://wordpress.stackexchange.com/a/211985

Thanks, Tom.

No problem :)

This archived topic is closed to new replies.