Force filename with JPG extension after resizing

Old name does not matter, since we just encoded it as JPEG
This commit is contained in:
Lonami Exo 2023-11-12 21:12:27 +01:00
parent 308f8e8bf8
commit ddc9bef503
2 changed files with 2 additions and 2 deletions

View File

@ -90,7 +90,7 @@ def _resize_photo_if_needed(
buffer = io.BytesIO() buffer = io.BytesIO()
result.save(buffer, 'JPEG', progressive=True, **kwargs) result.save(buffer, 'JPEG', progressive=True, **kwargs)
buffer.seek(0) buffer.seek(0)
buffer.name = getattr(file, 'name', None) buffer.name = 'a.jpg'
return buffer return buffer
except IOError: except IOError:
return file return file

View File

@ -1,3 +1,3 @@
# Versions should comply with PEP440. # Versions should comply with PEP440.
# This line is parsed in setup.py: # This line is parsed in setup.py:
__version__ = '1.32.0' __version__ = '1.32.1'