From: yomguy Date: Fri, 18 Jan 2013 08:28:44 +0000 (+0100) Subject: grapher: add Pillow support, thanks to Miroslav Shubernetskiy (closes: #12) X-Git-Tag: 0.4.3~2^2~1 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=a58bfaf0c10125e2f07b714e841da1b2f98c7a42;p=timeside.git grapher: add Pillow support, thanks to Miroslav Shubernetskiy (closes: #12) --- diff --git a/timeside/grapher/core.py b/timeside/grapher/core.py index c71d9de..f4acf38 100644 --- a/timeside/grapher/core.py +++ b/timeside/grapher/core.py @@ -23,11 +23,16 @@ # Guillaume Pellerin -import optparse, math, sys -import ImageFilter, ImageChops, Image, ImageDraw, ImageColor, ImageEnhance -import numpy +import optparse, math, sys, numpy + +try: + import ImageFilter, ImageChops, Image, ImageDraw, ImageColor, ImageEnhance +except ImportError: + from PIL import ImageFilter, ImageChops, Image, ImageDraw, ImageColor, ImageEnhance + from timeside.core import FixedSizeInputAdapter + default_color_schemes = { 'default': { 'waveform': [(50,0,200), (0,220,80), (255,224,0), (255,0,0)],