Generic camera: Allow svg detect to accept leading whitespace (#68932)
This commit is contained in:
parent
d25f7e1376
commit
3244980a35
2 changed files with 16 additions and 1 deletions
|
@ -114,7 +114,7 @@ def get_image_type(image):
|
|||
if fmt is None:
|
||||
# if imghdr can't figure it out, could be svg.
|
||||
with contextlib.suppress(UnicodeDecodeError):
|
||||
if image.decode("utf-8").startswith("<svg"):
|
||||
if image.decode("utf-8").lstrip().startswith("<svg"):
|
||||
return "svg+xml"
|
||||
return fmt
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue