Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sorl/thumbnail/engines/pil_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ def _colorspace(self, image, colorspace, format):
# Pillow JPEG doesn't allow RGBA anymore. It was converted to RGB before.
if image.mode == 'RGBA' and format != 'JPEG':
return image # RGBA is just RGB + Alpha
if image.mode == 'RGBA' and format == 'JPEG' and image.format != 'JPEG':
return image.convert('RGB')
if image.mode == 'LA' or (
image.mode == 'P' and 'transparency' in image.info and format != 'JPEG'
):
Expand Down