-
Notifications
You must be signed in to change notification settings - Fork 156
Image elements do not have explicit width and height - due to inline images #2073
Comments
I'm experiencing the same issue. I enabled following dimensions filters. But nothing worked. pagespeed EnableFilters insert_image_dimensions,resize_rendered_image_dimensions; |
I have found this response in 2015 Basically, inlined images have their dimensions encoded in the data uri. |
Thank you for your reply. However, I face this issue with my header image which is not inline by modpagespeed. |
Thanks for the replies CSS is no accepted by "Pagespeed Insights" as a workaround, and, disabling inline images defeats the whole purpose to begin with. Our point is, that we want inline images to show height and width. Or, at least, provide an option to do this. Thanks Dennis |
Sorry for come here too late, but I´m out of my house with limited internet access. @utags |
Yes, I think that is the relevant line, but I'm note sure if unconditionally deleting that line is the best approach.. |
I suspect deleting that line would cause all kinds of tests to need to be regolded. It would also be worse generally for performance because it makes the HTML bigger and might mean less is discovered by the browser in the first packet. But it might be more important to the customer to disable them so Lighthouse gives them a better score, than to actually have the best performance. The right thing might be to make it an option. |
The rationale, from a LH team member, is: until the image is decoded there is no image dimensions so the browser don´t reserve space for it and when the image is displayed there is a CLS. |
Dear fellow mod_pagespeed fans!
Is there anyway to undo:
"Image resized and then inlined into HTML as Base64 data. Because the inlined data has the desired dimensions, width and height are no longer needed."
@ref: https://www.modpagespeed.com/doc/filter-image-optimize
because Pagespeed Insights keeps complaining:
"Image elements do not have explicit width and height"
Can we add the height and width back in? Setting filter "insert_image_dimensions" did not work.
Thanks so kindly
Dennis
The text was updated successfully, but these errors were encountered: