-
Notifications
You must be signed in to change notification settings - Fork 638
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
[5.x]: Asset thumbnails distorted and blurry images in element cards #14866
Comments
@brianjhanson The aspect ratio bug was caused by #14834. The card view screenshot is expected. We want the image to fill the space. If the image is smaller than that space, it’s going to be a little blurry, regardless of whether the browser or a transform is upscaling it. |
It is expected if you don't control the area of the image in the card or the size (width and height) of the image source. Since you control both, you can make them match and therefore avoid unnecessary scaling. Of course if the original image is smaller, then scaling is unavoidable. But that's not the case here. |
@brandonkelly To make the above comment more clear, I think in element cards the transform ratio should be 1:1 (set to crop), since that is the ratio of the rendered image area. This way:
|
5.0.6 is out with that aspect ratio fix. |
5.1 is out with the card view fix. |
What happened?
Description
Asset thumbnails are not always keeping their aspect ratio and thus are sometimes distorted. Tested on Windows Chrome.
A simple solution would be to add
object-fit: contain;
to theimg
tag.Craft CMS version
5.0.5
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: