How do I add a with attribute to a responsive image with srcset?

by Benedikt   Last Updated January 19, 2018 17:07 PM

When using a responsive image with srcset the with and height attributes are not available in twig. Both of them are NULL When an image is uploaded that is too small images are stretched or blown up as described in this post: https://medium.com/@MRWwebDesign/responsive-images-the-sizes-attribute-and-unexpected-image-sizes-882a2eadb6db

Being able to set a with equal to the pixelsize of the image would solve this issue. How can I make these attributes available for twig?



Related Questions



How to use picture element as background image?

Updated November 28, 2017 21:07 PM

Image url expires

Updated January 11, 2017 08:03 AM


Get an image with style url from an URI in twig

Updated March 07, 2017 01:07 AM