Retina images don't preserve aspect ratios
See original GitHub issueI have one portrait image, which looks stretched. What I did was adding this to config:
ratio: 1.5,
replaceSrc: function(item) {
return item.src.replace(/\/\d+\//, function () {
return '/1920/';
});
}
my images come in different widths though, so I was not using the @2x modifier. When I open the image, it fills the screen height, but the width seems to be wrong.
Issue Analytics
- State:
- Created 9 years ago
- Comments:5
Top Results From Across the Web
CSS force image resize and keep aspect ratio - Stack Overflow
By specifying both you are changing the aspect ratio of the image. Just setting one will resize but preserve the aspect ratio.
Read more >New aspect-ratio CSS property supported in Chromium, Safari ...
Maintaining aspect ratio within images and elements is now easier to achieve with the new aspect-ratio CSS property.
Read more >3 Ways to Keep Image Aspect Ratio In HTML CSS - Code Boxx
To maintain the aspect ratio of images in CSS, the easiest way is to manually set the dimension of the width, then the...
Read more >Preserve an Image's Aspect Ratio When Resized | kirupa.com
Learn this one simple CSS trick to ensure your images resize automatically while ensuring the aspect ratio is maintained.
Read more >aspect-ratio - CSS-Tricks
Browsers do some fancy aspect ratio calculations on replaced content like images. So, if an image has, say, a width of 500px, the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I solved it by removing the bold lines.
I’m seeing this too. Had me very confused for a while! Any fixes for it yet?