sitegeist / sms-responsive-images

This TYPO3 extension provides ViewHelpers and configuration to render valid responsive images based on TYPO3's image cropping tool.
GNU General Public License v2.0
34 stars 18 forks source link

Set height attribute on img-tag when using lazy loading #105

Open sir-gawain opened 1 year ago

sir-gawain commented 1 year ago

If i use <picture> tag with sources with "srcset" and "sizes", and enable lazy loading using the native loading="lazy" attribute, Chrome does not load the images on page load. Adding the height attribute to the image-tag solves the problem.

Add in line 239 of ResponsiveImagesUtility.php: $fallbackTag->addAttribute('height', $fallbackImage->getProperty('height'));