When using Wagtail's image template tag, developers can provide a preserve-svg argument (docs). When supplied, this argument will cause Wagtail to limit the filters applied to SVGs to only those that would not require rasterisation - i.e. resize and crop operations. If not supplied, attempting to apply a rasterisation-requiring operation to an SVG will result in an error being raised, as Willow cannot perform the operation.
There is no equivalent to this in grapple. If acceptable, I would like to add this functionality. It looks like it would be sufficient to add a new argument to the rendition field (here), and update the resolve_rendition method with extra conditional logic (here).
When using Wagtail's
image
template tag, developers can provide apreserve-svg
argument (docs). When supplied, this argument will cause Wagtail to limit the filters applied to SVGs to only those that would not require rasterisation - i.e. resize and crop operations. If not supplied, attempting to apply a rasterisation-requiring operation to an SVG will result in an error being raised, as Willow cannot perform the operation.There is no equivalent to this in
grapple
. If acceptable, I would like to add this functionality. It looks like it would be sufficient to add a new argument to therendition
field (here), and update theresolve_rendition
method with extra conditional logic (here).