Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Area.py
diff options
context:
space:
mode:
Diffstat (limited to 'Area.py')
-rw-r--r--Area.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Area.py b/Area.py
index 50c0744..b889974 100644
--- a/Area.py
+++ b/Area.py
@@ -1038,13 +1038,22 @@ class Area(gtk.DrawingArea):
def proc_invert_color(temp_pix):
try:
import numpy
+ # HACK: This numpy version has a bug and breaks the
+ # 'invert_color' function
+ # http://bugs.sugarlabs.org/ticket/3509
+ if numpy.__version__ == '1.6.1':
+ logging.warning('You have installed a version of numpy '
+ '(1.6.1) that has a bug and can\'t be '
+ 'used. Using string module instead '
+ '(slower)')
+ raise ImportWarning
pix_manip2 = temp_pix.get_pixels_array()
pix_manip = numpy.ones(pix_manip2.shape, dtype=numpy.uint8) \
* 255
pix_manip2 = pix_manip - pix_manip2
temp_pix = gtk.gdk.pixbuf_new_from_array(pix_manip2,
gtk.gdk.COLORSPACE_RGB, 8)
- except:
+ except (ImportError, ImportWarning):
import string
a = temp_pix.get_pixels()
b = len(a) * ['\0']