From b5287ed17bda10877d84ba86fcf148ee74b93b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Thu, 3 Dec 2015 22:48:55 +0100 Subject: Imported Upstream version 0.4.11 --- rapid/ChangeLog | 13 +++++++++++++ rapid/INSTALL | 2 +- rapid/config.py | 2 +- rapid/rapid.py | 2 +- rapid/thumbnail.py | 4 ++-- rapid/utilities.py | 28 ++++++++++++++-------------- 6 files changed, 32 insertions(+), 19 deletions(-) (limited to 'rapid') diff --git a/rapid/ChangeLog b/rapid/ChangeLog index 5bac39c..ca66533 100644 --- a/rapid/ChangeLog +++ b/rapid/ChangeLog @@ -1,3 +1,16 @@ +Version 0.4.11 +-------------- + +2015-10-22 + +Updated Brazilian, Catalan, Croatian, Czech, German, Japanese, Norwegian, +Polish, Portuguese and Swedish translations. + +Fixed crash on systems using the library Pillow 3.0. + +Updated AppData file. + + Version 0.4.10 -------------- diff --git a/rapid/INSTALL b/rapid/INSTALL index 5d3dffa..84ef53f 100644 --- a/rapid/INSTALL +++ b/rapid/INSTALL @@ -6,7 +6,7 @@ Rapid Photo Downloader requires the following software: * python-gtk2 2.17 or higher * python-gconf 2.28 or higher * python-notify 0.1.1 or higher -* python-imaging 1.1.7 or higher +* python-imaging 2.0.0 or higher (Pillow) * librsvg2-common 2.26 or higher * exiftool * exiftran diff --git a/rapid/config.py b/rapid/config.py index 631bf47..03b86fa 100644 --- a/rapid/config.py +++ b/rapid/config.py @@ -16,7 +16,7 @@ ### Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ### USA -version = '0.4.10' +version = '0.4.11' GCONF_KEY="/apps/rapid-photo-downloader" diff --git a/rapid/rapid.py b/rapid/rapid.py index dd67b63..303e1f7 100755 --- a/rapid/rapid.py +++ b/rapid/rapid.py @@ -352,7 +352,7 @@ 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) stride = image_width * 4 image = cairo.ImageSurface.create_for_data(data, cairo.FORMAT_ARGB32, diff --git a/rapid/thumbnail.py b/rapid/thumbnail.py index ba72828..e10ae3d 100644 --- a/rapid/thumbnail.py +++ b/rapid/thumbnail.py @@ -129,10 +129,10 @@ class PicklablePIL: def __init__(self, image): self.size = image.size 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) def get_pixbuf(self): return image_to_pixbuf(self.get_image()) diff --git a/rapid/utilities.py b/rapid/utilities.py index 35c51ac..f0f0569 100644 --- a/rapid/utilities.py +++ b/rapid/utilities.py @@ -30,13 +30,13 @@ def get_full_path(path): return path else: return os.path.join(os.path.expanduser('~'), path) - + def is_directory(path): - + # for some very strange reason, doing it the GIO way fails with # unknown type, even for directories! return os.path.isdir(path) - + if False: d = gio.File(path) if d.query_exists(): @@ -44,14 +44,14 @@ def is_directory(path): file_type = file_info.get_file_type() if file_type == gio.FILE_TYPE_DIRECTORY: return True - + return False def format_size_for_user(bytes, zero_string="", with_decimals=True, kb_only=False): """Format an int containing the number of bytes into a string suitable for printing out to the user. zero_string is the string to use if bytes == 0. source: https://develop.participatoryculture.org/trac/democracy/browser/trunk/tv/portable/util.py?rev=3993 - + """ if bytes > (1 << 30) and not kb_only: value = (bytes / (1024.0 * 1024.0 * 1024.0)) @@ -84,10 +84,10 @@ def format_size_for_user(bytes, zero_string="", with_decimals=True, kb_only=Fals def register_iconsets(icon_info): """ Register icons in the icon set if they're not already used - + From http://faq.pygtk.org/index.py?req=show&file=faq08.012.htp """ - + icon_factory = gtk.IconFactory() stock_ids = gtk.stock_list_ids() for stock_id, file in icon_info: @@ -113,14 +113,14 @@ def image_to_pixbuf(image): # this is also from the pygtk FAQ IS_RGBA = image.mode=='RGBA' return gtk.gdk.pixbuf_new_from_data( - image.tostring(), # data + image.tobytes(), # data gtk.gdk.COLORSPACE_RGB, # color mode IS_RGBA, # has alpha 8, # bits image.size[0], # width image.size[1], # height (IS_RGBA and 4 or 3) * image.size[0] # rowstride - ) + ) def pixbuf_to_image(pb): assert(pb.get_colorspace() == gtk.gdk.COLORSPACE_RGB) @@ -131,22 +131,22 @@ def pixbuf_to_image(pb): mode = pb.get_has_alpha() and "RGBA" or "RGB" image = Image.frombuffer(mode, dimensions, pixels, "raw", mode, stride, 1) - + if mode == "RGB": # convert to having an alpha value, so that the image can - # act as a mask in the drop shadow paste + # act as a mask in the drop shadow paste image = image.convert("RGBA") return image - + def pythonify_version(v): """ makes version number a version number in distutils sense""" return distutils.version.StrictVersion(v.replace( '~','')) - + def human_readable_version(v): """ returns a version in human readable form""" v = v.replace('~a', ' alpha ') v = v.replace('~b', ' beta ') v = v.replace('~rc', ' RC ') return v - + -- cgit v1.2.3