summaryrefslogtreecommitdiff
path: root/media-video/photofilmstrip/files/photofilmstrip-2.1.0-PIL_tostring_fix.patch
blob: dc29c9c8e14f1d7d34422b444a5acb46f25d4a9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Gentoo-Bug: https://bugs.gentoo.org/584128

--- a/photofilmstrip/core/ProjectFile.py
+++ b/photofilmstrip/core/ProjectFile.py
@@ -196,7 +196,7 @@
     def __ThumbToQuery(self, picId, pic):
         pilThumb = PILBackend.GetThumbnail(pic, height=120)
         thumbWidth, thumbHeight = pilThumb.size
-        thumbData = buffer(pilThumb.tostring())
+        thumbData = buffer(pilThumb.tobytes())
         
         query = "INSERT INTO `thumbnail` (" \
                     "picture_id, width, height, data" \
--- a/photofilmstrip/core/renderer/CairoRenderer.py
+++ b/photofilmstrip/core/renderer/CairoRenderer.py
@@ -121,7 +121,7 @@
     def _PilToCairo(self, pilImg):
         pilImg = pilImg.copy()
         w, h = pilImg.size  
-        data = pilImg.convert('RGBA').tostring()
+        data = pilImg.convert('RGBA').tobytes()
         buff = array.array('B', data)
         cairoImage = cairo.ImageSurface.create_for_data(buff, cairo.FORMAT_ARGB32, w, h)
 #        cairoImage = cairo.ImageSurface.create_for_data(buff, cairo.FORMAT_RGB24, w, h)
--- a/photofilmstrip/core/renderer/PyGameRenderer.py
+++ b/photofilmstrip/core/renderer/PyGameRenderer.py
@@ -100,7 +100,7 @@
     def _PilToPyGame(self, pilImg):
         mode = pilImg.mode
         assert mode in "RGB", "RGBA"
-        return pygame.image.fromstring(pilImg.tostring(), pilImg.size, mode)
+        return pygame.image.frombytes(pilImg.tobytes(), pilImg.size, mode)
 
 
 #    def CropAndResize(self, ctx, rect):