shibukawa / imagesize_py

MIT License
222 stars 43 forks source link

Bug: SVG size #64

Open tuncbkose opened 3 months ago

tuncbkose commented 3 months ago

Hi, I just noticed that some of my svg files, obtained for example from dvisvgm, specify their size with width='{number}pt' and height='{number}pt'. For these files, the regex in https://github.com/shibukawa/imagesize_py/blob/8d88ec6b646d6184b5633604551d6fc154783073/imagesize/imagesize.py#L204-L215 doesn't match due to the different quotation marks.

I imagine one can naively change the regex to have something like ["|'], but then you would be matching incorrect strings like "wrong'. I'm sure this is a solved problem that is beyond my regex knowledge, but it would be nice for this to be fixed.