Gentoo Archives: gentoo-commits

From: Sergey Popov <pinkbyte@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/cropgui/files/, media-gfx/cropgui/
Date: Wed, 31 May 2017 06:42:45
Message-Id: 1496212955.9b50e2a36d6d2cc36c3b74054585128c32d2ba1d.pinkbyte@gentoo
1 commit: 9b50e2a36d6d2cc36c3b74054585128c32d2ba1d
2 Author: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 31 06:38:36 2017 +0000
4 Commit: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
5 CommitDate: Wed May 31 06:42:35 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b50e2a3
7
8 media-gfx/cropgui: revision bump
9
10 Backported fix: use tobytes() instead of deprecated tostring()
11 Drop old revision
12
13 Reported-by: Massimo Burcheri <massimo.burcheri <AT> gmx.de>
14 Gentoo-Bug: 616708
15
16 Package-Manager: Portage-2.3.5, Repoman-2.3.1
17
18 .../{cropgui-0.2.ebuild => cropgui-0.2-r1.ebuild} | 4 ++-
19 media-gfx/cropgui/files/cropgui-0.2-tobytes.patch | 40 ++++++++++++++++++++++
20 2 files changed, 43 insertions(+), 1 deletion(-)
21
22 diff --git a/media-gfx/cropgui/cropgui-0.2.ebuild b/media-gfx/cropgui/cropgui-0.2-r1.ebuild
23 similarity index 92%
24 rename from media-gfx/cropgui/cropgui-0.2.ebuild
25 rename to media-gfx/cropgui/cropgui-0.2-r1.ebuild
26 index 5518df4d23d..89341edb6d1 100644
27 --- a/media-gfx/cropgui/cropgui-0.2.ebuild
28 +++ b/media-gfx/cropgui/cropgui-0.2-r1.ebuild
29 @@ -1,4 +1,4 @@
30 -# Copyright 1999-2016 Gentoo Foundation
31 +# Copyright 1999-2017 Gentoo Foundation
32 # Distributed under the terms of the GNU General Public License v2
33
34 EAPI=6
35 @@ -31,6 +31,8 @@ src_prepare() {
36 cropgui.desktop || die 'sed on cropgui.desktop failed'
37 # bug 471530
38 eapply "${FILESDIR}/${P}-PIL.patch"
39 + # bug 616708
40 + eapply "${FILESDIR}/${P}-tobytes.patch"
41
42 eapply_user
43 }
44
45 diff --git a/media-gfx/cropgui/files/cropgui-0.2-tobytes.patch b/media-gfx/cropgui/files/cropgui-0.2-tobytes.patch
46 new file mode 100644
47 index 00000000000..18405143bad
48 --- /dev/null
49 +++ b/media-gfx/cropgui/files/cropgui-0.2-tobytes.patch
50 @@ -0,0 +1,40 @@
51 +commit b664d1fefd7140ec4ec37b3b90a9007839029d8a
52 +Author: Tristan Stenner <ttstenner@×××××.com>
53 +Date: Fri Oct 9 08:40:04 2015 +0200
54 +
55 + Try tostring(), fall back to tobytes()
56 +
57 +diff --git a/cropgtk.py b/cropgtk.py
58 +index c1156b0..135b6a8 100755
59 +--- a/cropgtk.py
60 ++++ b/cropgtk.py
61 +@@ -170,7 +170,11 @@ class DragManager(DragManagerBase):
62 + rendered = self.rendered()
63 + rendered = rendered.convert('RGB')
64 + i.set_size_request(*rendered.size)
65 +- pixbuf = gtk.gdk.pixbuf_new_from_data(rendered.tostring(),
66 ++ try:
67 ++ image_data = rendered.tostring()
68 ++ except:
69 ++ image_data = rendered.tobytes()
70 ++ pixbuf = gtk.gdk.pixbuf_new_from_data(image_data,
71 + gtk.gdk.COLORSPACE_RGB, 0, 8,
72 + rendered.size[0], rendered.size[1], 3*rendered.size[0])
73 +
74 +diff --git a/filechooser.py b/filechooser.py
75 +index f2f8122..a039d74 100644
76 +--- a/filechooser.py
77 ++++ b/filechooser.py
78 +@@ -49,7 +49,11 @@ def update_preview_cb(file_chooser, preview):
79 + i.thumbnail((PREVIEW_SIZE, PREVIEW_SIZE), Image.ANTIALIAS)
80 + i = i.convert('RGB')
81 + i = apply_rotation(r, i)
82 +- pixbuf = gtk.gdk.pixbuf_new_from_data(i.tostring(),
83 ++ try:
84 ++ image_data = i.tostring()
85 ++ except:
86 ++ image_data = i.tobytes()
87 ++ pixbuf = gtk.gdk.pixbuf_new_from_data(image_data,
88 + gtk.gdk.COLORSPACE_RGB, 0, 8, i.size[0], i.size[1],
89 + i.size[0]*3)
90 + preview.set_from_pixbuf(pixbuf)