[ocrfeeder] Fix issue with the pic's row in convertPixbufToImage



commit 249f2c3fc5192831241c09538758c241f5445741
Author: Joaquim Rocha <me joaquimrocha com>
Date:   Thu Dec 18 21:22:20 2014 +0000

    Fix issue with the pic's row in convertPixbufToImage

 src/ocrfeeder/util/graphics.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/ocrfeeder/util/graphics.py b/src/ocrfeeder/util/graphics.py
index fc8fc6f..4f6f3e9 100644
--- a/src/ocrfeeder/util/graphics.py
+++ b/src/ocrfeeder/util/graphics.py
@@ -71,7 +71,7 @@ def convertPixbufToImage(pixbuf):
         p = ''
         for j in range(pixbuf.get_height()):
             p += pixels[i:i + pixbuf.get_width() * num_channels]
-            i += pixbuf.width * num_channels
+            i += pixbuf.get_rowstride()
         pixels = p
 
     return Image.frombytes(mode, dimensions, pixels)


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