emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52966: closed ([PATCH 1/6] gnu: Add python-piexif.)


From: GNU bug Tracking System
Subject: bug#52966: closed ([PATCH 1/6] gnu: Add python-piexif.)
Date: Sat, 15 Jan 2022 20:38:02 +0000

Your message dated Sat, 15 Jan 2022 21:37:38 +0100
with message-id <27679d09-3d46-0d8e-c384-83087261abca@crazy-compilers.com>
and subject line Re: bug#52966: [PATCH 1/6] gnu: Add python-piexif.
has caused the debbugs.gnu.org bug report #52966,
regarding [PATCH 1/6] gnu: Add python-piexif.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
52966: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=52966
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH 1/6] gnu: Add python-piexif. Date: Sun, 2 Jan 2022 22:59:37 +0100
* 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.
---
 gnu/local.mk                                  |  1 +
 ...hon-piexif-fix-tests-with-pillow-7.2.patch | 44 +++++++++++++++++++
 gnu/packages/python-xyz.scm                   | 22 ++++++++++
 3 files changed, 67 insertions(+)
 create mode 100644 
gnu/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 852f9f3246..322b07ad74 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1678,6 +1678,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/python-keras-integration-test.patch     \
   %D%/packages/patches/python-peachpy-determinism.patch        \
   %D%/packages/patches/python-pep8-stdlib-tokenize-compat.patch \
+  %D%/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch   \
   %D%/packages/patches/python-pyfakefs-remove-bad-test.patch   \
   %D%/packages/patches/python-pyflakes-test-location.patch     \
   %D%/packages/patches/python-flint-includes.patch             \
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..a012a92f91
--- /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)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b6534c677f..4e408f1d49 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -27867,3 +27867,25 @@ keyboard-friendly package.")
     (description
      "This package provides a Python interface to iw wireless tools.")
     (license license:gpl2)))
+
+(define-public python-piexif
+  (package
+    (name "python-piexif")
+    (version "1.1.3")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "piexif" version ".zip"))
+        (sha256
+         (base32 "06sz58q4mrw472p8fbnq7wsj8zpi5js5r8phm2hiwfmz0v33bjw3"))
+        (patches
+         (search-patches "python-piexif-fix-tests-with-pillow-7.2.patch"))))
+    (build-system python-build-system)
+    (native-inputs
+     (list unzip python-pillow))
+    (home-page "https://github.com/hMatoba/Piexif";)
+    (synopsis "Simplify exif manipulations with Python")
+    (description "@code{Piexif} simplifies interacting with EXIF data in
+Python.  It includes the tools necessary for extracting, creating,
+manipulating, converting and writing EXIF data to JPEG, WebP and TIFF files.")
+    (license license:expat)))
-- 
2.30.2




--- End Message ---
--- Begin Message --- Subject: Re: bug#52966: [PATCH 1/6] gnu: Add python-piexif. Date: Sat, 15 Jan 2022 21:37:38 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1
Hi Ludo,

Thanks for the review. I changed what you requested and pushed as f542ef076a2238c36d5e9ed65836558375d3dd27

--
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]