AEM React SPA retina image with srcset showing large from the original image
- January 26, 2024
- 2 replies
- 1008 views
I am currently encountering an issue within Adobe Experience Manager (AEM) where implementing the Retina support feature through the 'srcset' attribute within the Image component results in slightly larger image displays. This discrepancy is particularly noticeable when working with images of smaller or medium sizes. Could you please provide guidance or assistance in resolving this matter?
Code Example:
<img src="/.../gb/demo/_jcr_content/root/responsivegrid/image.coreimg.png/1706262655053/flag-of-belgium.svg.png" alt="sgvd" srcset="/.../gb/demo/_jcr_content/root/responsivegrid/image.coreimg.82.375.png/1706262655053/flag-of-belgium.svg.png 375w,/.../gb/demo/_jcr_content/root/responsivegrid/image.coreimg.82.768.png/1706262655053/flag-of-belgium.svg.png 768w,/.../gb/demo/_jcr_content/root/responsivegrid/image.coreimg.82.1200.png/1706262655053/flag-of-belgium.svg.png 1200w">
Problem Screenshot:

In this image, the original image is 319 X 319 but the browser renders it 402 X 402, this problem happens on small or medium size images. How can I solve this problem it will show a large screen maximum like the original size and the lower screen will be a resized small image.
how can I achieve this any ideas or suggestions please write in the comment box.
Thanks, in advance.