The eleventy-img Eleventy Transform transforms imgsrcs but not imgsrcsets.
Desired
The eleventy-img Eleventy Transform transforms imgsrcs and imgsrcsets.
Motivation
Currently, the transform can be used to reduce the reliance on external resources by saving remote srcs locally. If an img has a remote source in srcset, that source is not transformed and the browser may select the remote source. Optimizing srcset sources would make the Eleventy Transform a (Twig macro-friendly) drop-in solution for local-ifying images with remote sources.
The optimization piece appears to be more complex. I skimmed the code, and paused. Could be down to make an attempt if given some pointers. But maybe that piece should be part of #215.
Current
The eleventy-img Eleventy Transform transforms
img
src
s but notimg
srcset
s.Desired
The eleventy-img Eleventy Transform transforms
img
src
s andimg
srcset
s.Motivation
Currently, the transform can be used to reduce the reliance on external resources by saving remote
src
s locally. If animg
has a remote source insrcset
, that source is not transformed and the browser may select the remote source. Optimizingsrcset
sources would make the Eleventy Transform a (Twig macro-friendly) drop-in solution for local-ifying images with remote sources.Solution
To get the ball rolling, here's a possible approach to the normalization piece https://github.com/olets/eleventy-img/compare/main..transform-srcset
The optimization piece appears to be more complex. I skimmed the code, and paused. Could be down to make an attempt if given some pointers. But maybe that piece should be part of #215.