From 36ae0a068879fed593a01e91c53a692e35643260 Mon Sep 17 00:00:00 2001 From: PeterPoetsch <113778281+PeterPoetsch@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:19:49 +0200 Subject: [PATCH] Using DPR to force the devices using the right image Devices with have higher then DPR 1 using different css pixel width from the source set. This leads to the problem that these devices are using the wrong image - using the one for a bigger with. This fix will solve this issue. --- .../image/v3/image/clientlibs/site/js/imageDynamicMedia.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/src/content/jcr_root/apps/core/wcm/components/image/v3/image/clientlibs/site/js/imageDynamicMedia.js b/content/src/content/jcr_root/apps/core/wcm/components/image/v3/image/clientlibs/site/js/imageDynamicMedia.js index 00578b2f14..b457ba53d6 100644 --- a/content/src/content/jcr_root/apps/core/wcm/components/image/v3/image/clientlibs/site/js/imageDynamicMedia.js +++ b/content/src/content/jcr_root/apps/core/wcm/components/image/v3/image/clientlibs/site/js/imageDynamicMedia.js @@ -80,7 +80,7 @@ if (keys.length > 0) { srcset = []; for (var key in autoSmartCrops) { - srcset.push(src.replace(SRC_URI_TEMPLATE_WIDTH_VAR, smartCrops[key]) + " " + key + "w"); + srcset.push(src.replace(SRC_URI_TEMPLATE_WIDTH_VAR, smartCrops[key]) + " " + parseInt(key * dpr) + "w"); } } return srcset.join(",");