3 ms·
I just threw together a test page, and it seems like WordPress does the right thing https://jakesdemosite975920295.wordpress.com/2022/07/12/test-post-title/ htt
by jaffathecake 4y ago
I just threw together a test page, and it seems like WordPress does the right thing https://jakesdemosite975920295.wordpress.com/2022/07/12/test-post-title/ https://jakesdemosite975920295.wordpress.com/2022/07/12/test....
Maybe you're using a custom theme that introduces buggy behaviour?
- chiefalchemist 4y agoI don't think so. I've seen this behavior for years across a number of themes and projects, as well as inspecting sites with dev tools. WordPress can't know, or at least be 100% certain of the image's dimensions. Yes, you can add custom images but there's no guarantee those will yield after the auto-resizing.
- jaffathecake 4y agoI created a wordpress post, added an image, and it generated a srcset. Every image had the same aspect ratio. What am I missing? Can you show me an example of the issue you're seeing, because if Wordpress is doing that, it's a bug, and I'd like to get them to fix it.
- chiefalchemist 4y agoWhat are the register image sizes in WP? Also, have to uploaded any images that might not satisfy the necessary dimensions. If WP was doing it correctly all the time there would be a question or two per week about images in the various WP groups I'm in. At the end of the day, you can have rules for WP cropping / resizing images. But those don't necessary guarantee the dimension of the image output from that. And WP certainly isn't checking each any every image for it's actual dimensions. And WP aside, it just doesn't make sense any output from a CMS is going to exactly what you expect. object-fit is a fail-safe. Object-fit is also smarter and better than a fixed size background image. The article has a narrow-ish use case.