Is there a way to have Responsive images with custom renditions from DAM render in Sites dynamically by image container size but not screen/windows size?
I have a requirement on if there are ways to use the custom renditions of the images created to be used dynamically to the web page as per the image container size defined in the sites but not by the screen size.
Currently, we are using <picture> tag and media query to render particular rendition of image however is there a way to go more deep to it to customize as per the image container size?
Sample Code:
<picture>
<source media="(max-width: 480px)" srcset="${item.image}/jcr:content/renditions/cq5dam.thumbnail.140.100.png">
<source media="(min-width: 1280px)" srcset="${item.image}/jcr:content/renditions/cq5dam.web.1280.1280.jpeg">
<source media="(min-width: 480px)" srcset="${item.image}/jcr:content/renditions/cq5dam.thumbnail.319.319.png">
<img src="${item.image}/jcr:content/renditions/cq5dam.web.1280.1280.jpeg" alt="${item.title}" class="img-fluid" loading="lazy">
</picture>In the HTL code above, for the sites loaded in the screen resolution of 1280px above, the rendition cq5dam.web.1280.1280.jpeg gets rendered, but if my image container as tiles is just 100x100px in the size, the image is way more high resolution to the image container so is there a way to optimize the image by rendering as per the container size rather than screen size?
NOTE: I am not looking into the options for the Dynamic Media integration as of now.