Skip to content

Commit

Permalink
Merge tag '0.25.8' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
felliott committed May 25, 2018
2 parents 889bf5c + 6430924 commit 0a436d2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
ChangeLog
*********

0.25.8 (2018-05-25)
===================
- Fix: Render paletted pngs by converting them to RGB before saving as jpeg.
- Code: Fix flake errors unrelated to this hotfix that were causing CI failures.

0.25.7 (2018-05-08)
===================
- Feature: Allow settings config variables from the environment via JSON strings. (thanks,
Expand Down
7 changes: 7 additions & 0 deletions mfr/extensions/image/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def export(self):
image = image.resize((round(image.size[0] * ratio),
round(image.size[1] * ratio)), Image.ANTIALIAS)

# Mode 'P' is for paletted images. They must be converted to RGB before exporting to
# jpeg, otherwise Pillow will throw an error. This is a temporary workaround, as the
# conversion is imprecise and can be ugly.
# See: https://stackoverflow.com/q/21669657
if image.mode == 'P':
image = image.convert('RGB')

# handle transparency
# from https://github.com/python-pillow/Pillow/issues/2609
if image.mode in ('RGBA', 'RGBa', 'LA') and type in ['jpeg', 'jpg']:
Expand Down
2 changes: 1 addition & 1 deletion mfr/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.25.7'
__version__ = '0.25.8'

0 comments on commit 0a436d2

Please sign in to comment.