]> git.parisson.com Git - timeside.git/commitdiff
grapher: add Pillow support, thanks to Miroslav Shubernetskiy (closes: #12)
authoryomguy <yomguy@parisson.com>
Fri, 18 Jan 2013 08:28:44 +0000 (09:28 +0100)
committeryomguy <yomguy@parisson.com>
Fri, 18 Jan 2013 08:28:44 +0000 (09:28 +0100)
timeside/grapher/core.py

index c71d9deab0e3810ae94a8e7323c49a4f7d870584..f4acf385978f9009b0b965b70fbafbb307782ebf 100644 (file)
 #   Guillaume Pellerin <yomguy@parisson.com>
 
 
-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)],