Issue with img sizing in lighthouse

Does anyone know how to fix this? When I remove the higher resolution images for the DPI I get this.
No description
No description
23 Replies
celine
celine8mo ago
hmm, maybe try to use something like twicpics to optimize your images? I think its features will solve your problem. https://www.twicpics.com/
TwicPics
TwicPics
Responsive Images as a Service
ἔρως
ἔρως8mo ago
before you do anything, stop if your design is responsive, and the image changes sizes, try to check how big/small it is, and all it's sizes honestly, i wouldn't do a whole lot with the images you already have
celine
celine8mo ago
if it's only one picture using something 3 partyish is surely too much
ἔρως
ἔρως8mo ago
he already has 2 images of 2 different sizes he probably just doesn't have it setup properly for example, it's complaining about the pixel size of the image maybe using min-resolution: 2dppx to load the large image for retina displays will clear the first error and the 2nd one, maybe he's loading the large image when he should be loading the small image
celine
celine8mo ago
Isn't that 2 errors for the same picture?
ἔρως
ἔρως8mo ago
no one is for ...-small.avif, the other for ...-large.avif
celine
celine8mo ago
oh, i see the title
ἔρως
ἔρως8mo ago
yes i think it's all just bad setup probably bad media queries or bad srcset we need more to check it better ourselves anyways
cmachdev
cmachdev8mo ago
<picture>
<source media="(min-width: 960px)"
srcset="images/all-business-large.avif 534w,
images/all-business-large.webp 534w,
images/all-business-large.jpg 534w,
images/all-business-large@2x.avif 1068w,
images/all-business-large@2x.webp 1068w,
images/all-business-large@2x.jpg 1068w,
images/all-business-large@3x.avif 1602w,
images/all-business-large@3x.webp 1602w,
images/all-business-large@3x.jpg 1602w"
sizes="534px">
<source media="(min-width: 600px)"
srcset="images/all-business-medium.avif 474w,
images/all-business-medium.webp 474w,
images/all-business-medium.jpg 474w,
images/all-business-medium@2x.avif 984w,
images/all-business-medium@2x.webp 984w,
images/all-business-medium@2x.jpg 984w,
images/all-business-medium@3x.avif 1422w,
images/all-business-medium@3x.webp 1422w,
images/all-business-medium@3x.jpg 1422w">
<source srcset="images/all-business-small.avif 273w,
images/all-business-small.webp 273w,
images/all-business-small.jpg 273w,
images/all-business-small@2x.avif 546w,
images/all-business-small@2x.webp 546w,
images/all-business-small@2x.jpg 546w,
images/all-business-small@3x.avif 819w,
images/all-business-small@3x.webp 819w,
images/all-business-small@3x.jpg 819w">
<img src="images/all-business-small.jpg" width="273" height="224" alt="This cat is all business">
</picture>
<picture>
<source media="(min-width: 960px)"
srcset="images/all-business-large.avif 534w,
images/all-business-large.webp 534w,
images/all-business-large.jpg 534w,
images/all-business-large@2x.avif 1068w,
images/all-business-large@2x.webp 1068w,
images/all-business-large@2x.jpg 1068w,
images/all-business-large@3x.avif 1602w,
images/all-business-large@3x.webp 1602w,
images/all-business-large@3x.jpg 1602w"
sizes="534px">
<source media="(min-width: 600px)"
srcset="images/all-business-medium.avif 474w,
images/all-business-medium.webp 474w,
images/all-business-medium.jpg 474w,
images/all-business-medium@2x.avif 984w,
images/all-business-medium@2x.webp 984w,
images/all-business-medium@2x.jpg 984w,
images/all-business-medium@3x.avif 1422w,
images/all-business-medium@3x.webp 1422w,
images/all-business-medium@3x.jpg 1422w">
<source srcset="images/all-business-small.avif 273w,
images/all-business-small.webp 273w,
images/all-business-small.jpg 273w,
images/all-business-small@2x.avif 546w,
images/all-business-small@2x.webp 546w,
images/all-business-small@2x.jpg 546w,
images/all-business-small@3x.avif 819w,
images/all-business-small@3x.webp 819w,
images/all-business-small@3x.jpg 819w">
<img src="images/all-business-small.jpg" width="273" height="224" alt="This cat is all business">
</picture>
ἔρως
ἔρως8mo ago
that's ... you really went overboard perhaps you have too many images and resolutions 474 and 546 are so close that it makes it worthless to have that difference there 1068w 984w 819w just basically the same what's the size of the image on the page, when you show it? does it even change? i think you went about this in a way to appease the almighty lighthouse results, instead of checking what's going on with the image yourself
cmachdev
cmachdev8mo ago
Change
ἔρως
ἔρως8mo ago
have you tried to check the image size at multiple resolutions?
cmachdev
cmachdev8mo ago
Let me check
ἔρως
ἔρως8mo ago
here's something you can try you can check for an onresize event of the window then, send to the console the actual width and height of the image element and also send the width and height of the window something like: window: 1920x1080 - image: 300x500 then you can see the sizes of the image and just start with the maximum resolution of your page down to the lowest
vince
vince8mo ago
All that error is saying is that your image size is too big / small compared to the rendered size
Want results from more Discord servers?
Add your server