Skip to content
Snippets Groups Projects
Commit 7d6f6e85 authored by techknowlogick's avatar techknowlogick Committed by Eliot Berriot
Browse files

Allow files with upper case extensions when uploading avatar

Discovered when attempting to upload a file with name avatar.JPG

The following error was reported in the logs:
```
File "/app/funkwhale_api/common/serializers.py", line 213, in to_internal_value
     format=PIL.Image.EXTENSION[os.path.splitext(file_obj.name)[-1]],
 KeyError: '.JPG'
```
parent e9553a01
No related branches found
No related tags found
No related merge requests found
......@@ -219,7 +219,7 @@ class StripExifImageField(serializers.ImageField):
with io.BytesIO() as output:
image_without_exif.save(
output,
format=PIL.Image.EXTENSION[os.path.splitext(file_obj.name)[-1]],
format=PIL.Image.EXTENSION[os.path.splitext(file_obj.name)[-1].lower()],
quality=100,
)
content = output.getvalue()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment