[ocrfeeder/introspection: 10/14] Port graphics.py to GI



commit 984aea6a782a3f522b55ad9f228c74d6d63af6ec
Author: Joaquim Rocha <me joaquimrocha com>
Date:   Tue Oct 15 19:53:16 2013 +0200

    Port graphics.py to GI

 src/ocrfeeder/util/graphics.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/ocrfeeder/util/graphics.py b/src/ocrfeeder/util/graphics.py
index b93fc5f..af38031 100644
--- a/src/ocrfeeder/util/graphics.py
+++ b/src/ocrfeeder/util/graphics.py
@@ -20,7 +20,7 @@
 
 from lib import debug
 from PIL import Image
-import gtk
+from gi.repository import GdkPixbuf
 import math
 
 def getContainerRectangle(points_list):
@@ -52,7 +52,7 @@ def getBoundsFromStartEndPoints(start_point, end_point):
     return start_x, start_y, width, height
 
 def convertPixbufToImage(pixbuf):
-    assert(pixbuf.get_colorspace() == gtk.gdk.COLORSPACE_RGB)
+    assert(pixbuf.get_colorspace() == GdkPixbuf.Colorspace.RGB)
     dimensions = pixbuf.get_width(), pixbuf.get_height()
     stride = pixbuf.get_rowstride()
     pixels = pixbuf.get_pixels()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]