Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect srcset for retina images in 3.1.0 #256

Closed
TedAvery opened this issue Nov 20, 2015 · 1 comment
Closed

Incorrect srcset for retina images in 3.1.0 #256

TedAvery opened this issue Nov 20, 2015 · 1 comment
Labels

Comments

@TedAvery
Copy link

Hi again,

I've installed the latest update to 3.1.0, and now all the pictures across our entire site that looked so beautiful on my 13" retina display are now blurry.

Example post

There are several images here (e.g. the snowy forest one) that span the entire width of the screen. Using Chrome's web inspector, I can identify that the currentSrc I am being served is 1024x681. In previous versions of the plugin, I was being served the full size of the image, so this looked nice and sharp. I'm assuming something in the srcset generation changed, but I'm not really sure what.

@jaspermdegroot
Copy link
Member

@TedAvery

This is because we added $max_srcset_image_width and its default value is 1600. You can change this value with the max_srcset_image_width filter hook:

function my_max_srcset_image_width( $max_width ) {
    return 2048;
}
add_filter( 'max_srcset_image_width', 'my_max_srcset_image_width' );

When you add that to your functions.php it will change the maximum to 2048px.

If you use even larger images on your site I would recommend to not increase the limit even more, but add a custom image size with a width of 2048 (add_image_size( 'my_hd_img_size', 2048, 2048, false ); + regenerate thumbnails) instead. That's better than including a very large uncompressed image just for HD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants