View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000344 | file | General | public | 2022-05-11 06:13 | 2022-05-21 22:47 |
Reporter | rven | Assigned To | christos | ||
Priority | high | Severity | major | Reproducibility | always |
Status | feedback | Resolution | open | ||
OS Version | Ubuntu 20.04.4 L | ||||
Product Version | 5.41 | ||||
Summary | 0000344: image/svg+xml not correctly guessed from buffer | ||||
Description | When a svg needs to be parsed with the from_buffer method, it returns an incorrect mimetype when the <?xml version='1.0' encoding='UTF-8' ?> tag is included on top of the xml declaration | ||||
Steps To Reproduce | import magic a = b"<svg height='180' width='180' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><rect fill='hsl(349, 60%, 45%)' height='180' width='180'/><text fill='#ffffff' font-size='96' text-anchor='middle' x='90' y='125' font-family='sans-serif'>M</text></svg>" magic.from_buffer(a, mime=True) => 'image/svg+xml' import magic a = b"<?xml version='1.0' encoding='UTF-8' ?><svg height='180' width='180' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><rect fill='hsl(349, 60%, 45%)' height='180' width='180'/><text fill='#ffffff' font-size='96' text-anchor='middle' x='90' y='125' font-family='sans-serif'>M</text></svg>" magic.from_buffer(a, mime=True) => 'text/xml' | ||||
Tags | No tags attached. | ||||