Skip to content
Permalink
Browse files

Try fixing issue #108 - compat with pillow 6.0

See #108 .
  • Loading branch information...
shlomif committed Apr 5, 2019
1 parent 2e67242 commit 1d3ffc4e1d51ad197e39417574085d0fa32b6689
Showing with 4 additions and 9 deletions.
  1. +1 −1 pysollib/mfxutil.py
  2. +3 −8 pysollib/ui/tktile/tkutil.py
@@ -51,7 +51,7 @@
from PIL import PpmImagePlugin # noqa: F401
Image._initialized = 2
USE_PIL = False
if TOOLKIT == 'tk' and Image and Image.VERSION >= '1.1.7':
if TOOLKIT == 'tk' and Image:
USE_PIL = True

# debug
@@ -353,15 +353,10 @@ def shadowImage(image, color='#3896f8', factor=0.3):
if not hasattr(image, '_pil_image'):
return None
im = image._pil_image
if Image.VERSION >= '1.1.7':
# use an alpha image
sh = Image.new('RGBA', im.size, color)
sh.putalpha(100)
out = Image.composite(sh, im, im)
return PIL_Image(image=out)
# use an alpha image
sh = Image.new('RGBA', im.size, color)
tmp = Image.blend(im, sh, factor)
out = Image.composite(tmp, im, im)
sh.putalpha(100)
out = Image.composite(sh, im, im)
return PIL_Image(image=out)


0 comments on commit 1d3ffc4

Please sign in to comment.
You can’t perform that action at this time.