-
Notifications
You must be signed in to change notification settings - Fork 53
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
srcset missing for some cropped sizes #217
Comments
Hey Solange, the |
Thanks Tevko for replying so promptly, I have set the new image size like this:
where the exact image size exists, ie it was cropped at both width / height, then I get this in the html:
But where 'image-921x522.jpg' does not exist because it was cropped in one direction only, ie image-720x522.jpg as per original comment, than i get this in the html:
However if I use a non-cropped size (eg, "large") then it works fine. |
@solange this behavior makes sense, because we filter out sizes that don't have the same aspect ratio as the original image |
It's interesting that the |
version 2.5.2 |
Correct. For a |
Ok many thanks joemcgill & tevko. Cheers |
We fixed that in the WordPress core patch by first checking if we have both |
Hello,
I'm using this in a template:
< img src="'.$image[url].'" '.tevkori_get_srcset_string( $image['ID'], "img_920x522"). '>
where the image size is set to cropped 'true', and it works very well for most images.
However, I have an image where the original size is 720x960, and the image name at my default size as per above is myimage-720x522.jpg in which case tevkori_get_srcset_string returns nothing, I guess because it can't find the exact size/image name. What's the work around for those situations so I can get a full srcset? Thanks you
The text was updated successfully, but these errors were encountered: