torchbox / wagtail-grapple

A Wagtail app that makes building GraphQL endpoints a breeze!
https://wagtail-grapple.readthedocs.io/en/latest/
Other
153 stars 57 forks source link

Add equivalent of wagtailimages_tags.image's "preserve-svg" argument #345

Closed jams2 closed 1 year ago

jams2 commented 1 year ago

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).

zerolab commented 1 year ago

Go for it @jams2

zerolab commented 1 year ago

[!note] Work in progress notes to self