From bd3d8fc923c299f5f279a299ebb04ad605007e14 Mon Sep 17 00:00:00 2001 From: Helmut Pozimski Date: Tue, 18 Jun 2019 22:03:50 +0200 Subject: [PATCH] cinnamon: add patch to fix cinnamon-settings with current Pillow versions fixes #12532 --- ...78cf57b80b977401460a147602832157b303.patch | 64 +++++++++++++++++++ srcpkgs/cinnamon/template | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/cinnamon/patches/595178cf57b80b977401460a147602832157b303.patch diff --git a/srcpkgs/cinnamon/patches/595178cf57b80b977401460a147602832157b303.patch b/srcpkgs/cinnamon/patches/595178cf57b80b977401460a147602832157b303.patch new file mode 100644 index 0000000000..0e2bf8c54b --- /dev/null +++ b/srcpkgs/cinnamon/patches/595178cf57b80b977401460a147602832157b303.patch @@ -0,0 +1,64 @@ +From 595178cf57b80b977401460a147602832157b303 Mon Sep 17 00:00:00 2001 +From: Eli Schwartz +Date: Fri, 5 Apr 2019 11:28:45 -0400 +Subject: [PATCH] PIL: remove unnnecessary version check and code fork (#8496) + +The Image.VERSION variable was deprecated some time ago and is now gone +entirely. But its only use was to determine whether we were using at +least the latest version of PIL, or any version of its fork, Pillow. And +PIL was last developed in 2009 and does not support python3 at all, so +we are guaranteed to be using Pillow. + +Moreover, the check does not really matter, as Pillow is guaranteed to +load any image it opens, without the user doing so manually. + +Fixes #8495 +--- + .../cinnamon/cinnamon-settings/bin/imtools.py | 27 +------------------ + 1 file changed, 1 insertion(+), 26 deletions(-) + +diff --git a/files/usr/share/cinnamon/cinnamon-settings/bin/imtools.py b/files/usr/share/cinnamon/cinnamon-settings/bin/imtools.py +index 05605001f7..c386fe3847 100644 +--- files/usr/share/cinnamon/cinnamon-settings/bin/imtools.py ++++ files/usr/share/cinnamon/cinnamon-settings/bin/imtools.py +@@ -620,31 +620,6 @@ def has_transparency(image): + has_alpha(image) + + +-if Image.VERSION == '1.1.7': +- +- def split(image): +- """Work around for bug in Pil 1.1.7 +- +- :param image: input image +- :type image: PIL image object +- :returns: the different color bands of the image (eg R, G, B) +- :rtype: tuple +- """ +- image.load() +- return image.split() +-else: +- +- def split(image): +- """Work around for bug in Pil 1.1.7 +- +- :param image: input image +- :type image: PIL image object +- :returns: the different color bands of the image (eg R, G, B) +- :rtype: tuple +- """ +- return image.split() +- +- + def get_alpha(image): + """Gets the image alpha band. Can handles P mode images with transpareny. + Returns a band with all values set to 255 if no alpha band exists. +@@ -655,7 +630,7 @@ def get_alpha(image): + :rtype: single band image object + """ + if has_alpha(image): +- return split(image)[-1] ++ return image.split()[-1] + if image.mode == 'P' and 'transparency' in image.info: + return image.convert('RGBA').split()[-1] + # No alpha layer, create one. diff --git a/srcpkgs/cinnamon/template b/srcpkgs/cinnamon/template index 84c7eb30e7..57b9b24a17 100644 --- a/srcpkgs/cinnamon/template +++ b/srcpkgs/cinnamon/template @@ -1,7 +1,7 @@ # Template file for 'cinnamon' pkgname=cinnamon version=4.0.10 -revision=1 +revision=2 build_style=gnu-configure configure_args="--disable-static --disable-schemas-compile --enable-compile-warnings=no --disable-gtk-doc"