post thumbnails - Missing image size

admin2025-06-05  2

I have added a couple of custom sizes to my wordpress environment with the following code:

add_image_size( "maximal", "1900" );
add_image_size( "desktop", "1400" );
add_image_size( "tablet", "900" );
add_image_size( "smalltablet", "700" );
add_image_size( "mobile", "500" );
add_theme_support( 'post-thumbnails' ); 

but when I call an image, the 1900px version is always missing:

<img src="test.laurentwillen.be/pixel.gif" class="attachment-mobile size-mobile wp-post-image" alt="Xiaomi Mi 8 Lite test, avis et prix" srcset=".jpg 500w, .jpg 300w, .jpg 768w, .jpg 1024w, .jpg 1400w, .jpg 900w, .jpg 700w" width="100%">

In the end I see the following formats in my images: 300, 500, 700, 768, 900, 1024, 1400

I should probably remove the old WP sizes but I really don't get why I'm not getting the 1900px format even if I visit a page on a 2k screen. The consequence is that people with a resolution around 1600 and more get lower quality images.

Do you have any idea of what I should do to have those 1900px images ? I already regenerated my thumbnails.

Thanks

Laurent

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749138074a316683.html

最新回复(0)