When I looked at Fuji X Weekly this morning, I immediately noticed a weird issue: some photos were not displaying the correct size. Some were, some were not. There didn’t seem to be any rhyme or reason to it. After some investigating, I discovered that the issue was only on Google Chrome, and not Safari or other browsers. And only on desktop, and not mobile. After a lot of frustration, and then some help from WordPress, I found the issue and fixed it.
Here’s what it looked like:
Left: Google Chrome / Right: Safari
First, let me apologize if your viewing experience was abnormal. It was normal before my weekend trip to Philadelphia (can’t wait to write about that), and very much not normal when I looked at the website this morning. I spent a few hours today trying to figure it out. I’m not exactly sure what changed, but the issue was clearly with Chrome—something that they adjusted recently, apparently. I’m a photographer and not an IT specialist, but sometimes I’ve got to put on my webmaster hat. I’ve been able to resolve most of the issues over the years, thanks to those who have shared their solutions publicly, have emailed me directly with a fix, and the WordPress help desk. If you ever see something on Fuji X Weekly that doesn’t look right, please let me know.
WordPress advised me that the specific issue affecting this website is how Chrome now handles lazy-loading images. For those who don’t know (I didn’t know until a few minutes ago), lazy loading is an optimization technique for loading pages faster and reducing memory. It’s good when it works, but obviously not good when it doesn’t. Google changed something with how Chrome lazily loads pictures, and my website was affected by this. Thankfully, someone figured out an easy fix.
If you have a WordPress page and have noticed Chrome not displaying photos the correct size, add this custom CSS code to your website:
img[loading=”lazy”] {
width: revert-layer !important;
}
If you are not sure where to do that, it’s found in Apparence -> Customize -> Additional CSS. I hope this information is helpful to someone. For the rest of you, sorry to take you through the weeds, and for the problem. Now that it’s fixed, I can get back to the things that I was hoping to get to today. Like lunch. And a second cup of coffee.