ensure color mode compatibility when making image thumbnails

This commit is contained in:
cfdv 2011-06-12 17:35:07 -05:00 committed by Christopher Allan Webber
parent 300c34e8ce
commit 34d35a2393

View File

@ -41,6 +41,9 @@ def process_media_initial(media_id):
with queued_file:
thumb = Image.open(queued_file)
thumb.thumbnail(THUMB_SIZE, Image.ANTIALIAS)
# ensure color mode is compatible with jpg
if thumb.mode != "RGB":
thumb = thumb.convert("RGB")
thumb_filepath = mgg.public_store.get_unique_filepath(
['media_entries',