Commit b0ac34de authored by Serge Koval's avatar Serge Koval

Small optimization

parent ffae64dd
...@@ -466,7 +466,7 @@ class ImageUploadField(FileUploadField): ...@@ -466,7 +466,7 @@ class ImageUploadField(FileUploadField):
def _save_image(self, image, path, format='JPEG'): def _save_image(self, image, path, format='JPEG'):
# New Pillow versions require RGB format for JPEGs # New Pillow versions require RGB format for JPEGs
if format == 'JPEG': if format == 'JPEG' and image.mode != 'RGB':
image = image.convert('RGB') image = image.convert('RGB')
elif image.mode not in ('RGB', 'RGBA'): elif image.mode not in ('RGB', 'RGBA'):
image = image.convert('RGBA') image = image.convert('RGBA')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment