From a58bfaf0c10125e2f07b714e841da1b2f98c7a42 Mon Sep 17 00:00:00 2001 From: yomguy Date: Fri, 18 Jan 2013 09:28:44 +0100 Subject: [PATCH] grapher: add Pillow support, thanks to Miroslav Shubernetskiy (closes: #12) --- timeside/grapher/core.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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)], -- 2.39.5