Package: rapid-photo-downloader
Version: 0.4.10-3
Severity: important
Tags: patch

Dear Maintainer,

the latest version of python-imaging replaced the tostring() and
fromstring() methods of the Image class with versions that raise an
exception, telling the user to use tobytes() and frombytes(), resp.

This breaks rpd in such a way that it doesn't display thumbnails
anymore. Instead, it prints the exceptions and displays nothing in place
of the thumbnails.

Replacing all occurrences of these two methods fixes the problem,
although I'm not certain that this is enough - some warnings on the
console remain but they could be unrelated as the program seems to work
fine.

Attached is a patch that does just that.


Cheers,
  Chris


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.2.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages rapid-photo-downloader depends on:
ii  exiftran                2.10-2
ii  exiv2                   0.25-2.1
ii  gnome-icon-theme        3.12.0-1
ii  libimage-exiftool-perl  10.07-1
ii  librsvg2-common         2.40.12-1
ii  python-dbus             1.2.0-2+b4
ii  python-gconf            2.28.1+dfsg-1.1
ii  python-glade2           2.24.0-4
ii  python-gnome2           2.28.1+dfsg-1.1
ii  python-gtk2             2.24.0-4
ii  python-imaging          3.0.0-1
ii  python-notify           0.1.1-4
ii  python-pyexiv2          0.3.2-8+b1
ii  python2.7               2.7.10-5+b1
pn  python:any              <none>

Versions of packages rapid-photo-downloader recommends:
ii  ffmpegthumbnailer        2.0.10-0.1
ii  python-hachoir-metadata  1.3.3-2
ii  python-kaa-metadata      0.7.7+svn4596-4

rapid-photo-downloader suggests no packages.

-- no debconf information
diff -p1 -Nur rapid-photo-downloader-0.4.10.orig/rapid/rapid.py rapid-photo-downloader-0.4.10/rapid/rapid.py
--- rapid-photo-downloader-0.4.10.orig/rapid/rapid.py	2014-01-21 16:09:46.000000000 +0100
+++ rapid-photo-downloader-0.4.10/rapid/rapid.py	2015-12-03 17:46:01.723860094 +0100
@@ -354,3 +354,3 @@ class DeviceCollection(gtk.TreeView):
 def create_cairo_image_surface(pil_image, image_width, image_height):
-        imgd = pil_image.tostring("raw","BGRA", 0, 1)
+        imgd = pil_image.tobytes("raw","BGRA", 0, 1)
         data = array.array('B',imgd)
diff -p1 -Nur rapid-photo-downloader-0.4.10.orig/rapid/thumbnail.py rapid-photo-downloader-0.4.10/rapid/thumbnail.py
--- rapid-photo-downloader-0.4.10.orig/rapid/thumbnail.py	2014-01-10 11:19:06.000000000 +0100
+++ rapid-photo-downloader-0.4.10/rapid/thumbnail.py	2015-12-03 17:45:35.627583308 +0100
@@ -131,6 +131,6 @@ class PicklablePIL:
         self.mode = image.mode
-        self.image_data = image.tostring()
+        self.image_data = image.tobytes()
 
     def get_image(self):
-        return Image.fromstring(self.mode, self.size, self.image_data)
+        return Image.frombytes(self.mode, self.size, self.image_data)
 
diff -p1 -Nur rapid-photo-downloader-0.4.10.orig/rapid/utilities.py rapid-photo-downloader-0.4.10/rapid/utilities.py
--- rapid-photo-downloader-0.4.10.orig/rapid/utilities.py	2012-05-30 08:27:00.000000000 +0200
+++ rapid-photo-downloader-0.4.10/rapid/utilities.py	2015-12-03 17:45:48.807723114 +0100
@@ -115,3 +115,3 @@ def image_to_pixbuf(image):
     return gtk.gdk.pixbuf_new_from_data(
-            image.tostring(), # data
+            image.tobytes(), # data
             gtk.gdk.COLORSPACE_RGB, # color mode

Reply via email to