wagtail / Willow

A wrapper that combines the functionality of multiple Python image libraries into one API
https://willow.wagtail.org/
BSD 3-Clause "New" or "Revised" License
273 stars 53 forks source link

SvgViewBoxParseError at /cms/images/ #127

Closed bachi76 closed 1 year ago

bachi76 commented 1 year ago

Issue Summary

Wagtail images breaks completely when it cannot parse an svg image correctly. Example given. Error: SvgViewBoxParseError at /cms/images/ Unable to parse viewBox value '-5.000000011410315e-06 0.0 750.00001 525.000007'

Notice the -5.000000011410315e-06 value which is likely the culprit. However, the svg validates as valid.

Steps to Reproduce

Upload the attached svg image, then in Wagtail go to "Images". Or try to add one to a page using the chooser.

Technical details

zerolab commented 1 year ago

@bachi76 thank you for reporting this. I've moved it to the Willow issue queue as this is where the underlying issue is (https://github.com/wagtail/Willow/blob/main/willow/svg.py#L256) which is failing because of the https://github.com/wagtail/Willow/blob/main/willow/svg.py#L124-L128 regex

zerolab commented 1 year ago

This is now in v1.5.2, and 1.6.1

bachi76 commented 1 year ago

Wow - that was fast - thanks @zerolab !

zerolab commented 1 year ago

All thanks to @jams2 👏🏼