diff options
author | Hartmut Goebel <h.goebel@crazy-compilers.com> | 2021-12-19 12:56:59 +0100 |
---|---|---|
committer | Hartmut Goebel <h.goebel@crazy-compilers.com> | 2022-01-15 21:35:05 +0100 |
commit | e0ba031ab27478ebfd683487d179759f45a89f0d (patch) | |
tree | f5de1396a574164ce55a64972633623c10119286 /gnu/packages/patches | |
parent | 29fc4a7daeae5d4d2c5385dbf6ae05fcbf302eb0 (diff) | |
download | guix-e0ba031ab27478ebfd683487d179759f45a89f0d.tar.gz guix-e0ba031ab27478ebfd683487d179759f45a89f0d.zip |
gnu: Add python-piexif.
* gnu/packages/python-xyz.scm (python-piexif): New variable.
* gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch: New file.
* gnu/packages/python-xyz.scm (dist_patch_DATA): Add it.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch b/gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch new file mode 100644 index 0000000000..caa2c47c08 --- /dev/null +++ b/gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch @@ -0,0 +1,44 @@ +From 5209b53e9689ce28dcd045f384633378d619718f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20Wi=C5=9Bniewski?= <vuko@vuko.pl> +Date: Thu, 5 Nov 2020 16:18:52 +0100 +Subject: [PATCH] convert IFDRational to tuples in tests + +This fixes tests with Pillow version >= 7.2.0 +--- + tests/s_test.py | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/tests/s_test.py b/tests/s_test.py +index 5d105de..a7cad54 100644 +--- a/tests/s_test.py ++++ b/tests/s_test.py +*************** +*** 9,14 **** +--- 9,15 ---- + import time + import unittest + ++ import PIL + from PIL import Image + import piexif + from piexif import _common, ImageIFD, ExifIFD, GPSIFD, TAGS, InvalidImageDataError +*************** +*** 580,585 **** +--- 581,597 ---- + # test utility methods---------------------------------------------- + + def _compare_value(self, v1, v2): ++ if isinstance(v2, PIL.TiffImagePlugin.IFDRational): ++ v2 = (v2.numerator, v2.denominator) ++ if isinstance(v2, tuple): ++ converted_v2 = [] ++ for el in v2: ++ if isinstance(el, PIL.TiffImagePlugin.IFDRational): ++ converted_v2.append((el.numerator, el.denominator)) ++ else: ++ converted_v2.append(el) ++ v2 = tuple(converted_v2) ++ + if type(v1) != type(v2): + if isinstance(v1, tuple): + self.assertEqual(pack_byte(*v1), v2) |