diff options
author | cfdv <caldavis@gmail.com> | 2011-06-12 17:35:07 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-06-12 17:35:07 -0500 |
commit | 34d35a23930815438a4e1d8b28ec17016fb938c0 (patch) | |
tree | 776b23cad347a6959e3176f935dc7407dda4b0ec /mediagoblin | |
parent | 300c34e8ce52f20ba789c22c26bdc78b9ecb2954 (diff) | |
download | mediagoblin-34d35a23930815438a4e1d8b28ec17016fb938c0.tar.lz mediagoblin-34d35a23930815438a4e1d8b28ec17016fb938c0.tar.xz mediagoblin-34d35a23930815438a4e1d8b28ec17016fb938c0.zip |
ensure color mode compatibility when making image thumbnails
Diffstat (limited to 'mediagoblin')
-rw-r--r-- | mediagoblin/process_media/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mediagoblin/process_media/__init__.py b/mediagoblin/process_media/__init__.py index c71c5dda..f0a6e511 100644 --- a/mediagoblin/process_media/__init__.py +++ b/mediagoblin/process_media/__init__.py @@ -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', |