react-image icon indicating copy to clipboard operation
react-image copied to clipboard

height parameter missing in srcset

Open moritz-helten opened this issue 3 years ago • 1 comments

If an image should be cropped, the output is correct on the src attribute, see: w:3572,h:714 in the example below. In the srcset the urls do not have a height, see w:893 in the example below.

<img 
alt="" 
title="" srcset="https://media.graphcms.com/resize=w:893,fit:crop/output=quality:95,strip:true/sharpen=amount:1/auto_image/compress/Q5aVZCmpSB29FhCL9O2R 893w,https://media.graphcms.com/resize=w:1786,fit:crop/output=quality:95,strip:true/sharpen=amount:1/auto_image/compress/Q5aVZCmpSB29FhCL9O2R 1786w,
https://media.graphcms.com/resize=w:3572,fit:crop/output=quality:95,strip:true/sharpen=amount:1/auto_image/compress/Q5aVZCmpSB29FhCL9O2R 3572w"
src="https://media.graphcms.com/resize=w:3572,h:714,fit:crop/output=quality:95,strip:true/sharpen=amount:1/auto_image/compress/Q5aVZCmpSB29FhCL9O2R" 
sizes="(max-width: 3572px) 100vw, 3572px" style="position: absolute; top: 0px; left: 0px; transition-duration: 0.5s; transition-timing-function: ease; transition-property: opacity; opacity: 1; width: 100%; height: 100%; object-fit: cover; object-position: center center;">

The goal is to have consistent aspect ratios in the src and srcset images.

moritz-helten avatar Jun 23 '22 07:06 moritz-helten

Do you have any news on this issue?

moritz-helten avatar Sep 15 '22 09:09 moritz-helten