[Git][debian-gis-team/pyninjotiff][master] 2 commits: New 0003-numpy-2.3-compat.patch

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Fri Sep 12 07:11:15 BST 2025



Antonio Valentino pushed to branch master at Debian GIS Project / pyninjotiff


Commits:
bcc7ac4f by Antonio Valentino at 2025-09-11T06:00:37+00:00
New 0003-numpy-2.3-compat.patch

- - - - -
09be7467 by Antonio Valentino at 2025-09-12T06:10:19+00:00
Set distribution to unstable

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/0003-numpy-2.3-compat.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+pyninjotiff (0.4.2-2) unstable; urgency=medium
+
+  * debian/patches:
+    - New 0003-numpy-2.3-compat.patch (Closes: #1114712).
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it>  Fri, 12 Sep 2025 06:09:03 +0000
+
 pyninjotiff (0.4.2-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
debian/patches/0003-numpy-2.3-compat.patch
=====================================
@@ -0,0 +1,100 @@
+From: Antonio Valentino <antonio.valentino at tiscali.it>
+Date: Thu, 11 Sep 2025 05:59:06 +0000
+Subject: numpy-2.3-compat
+
+---
+ pyninjotiff/tifffile.py | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/pyninjotiff/tifffile.py b/pyninjotiff/tifffile.py
+index a1aeeeb..b16104d 100644
+--- a/pyninjotiff/tifffile.py
++++ b/pyninjotiff/tifffile.py
+@@ -1889,13 +1889,13 @@ class TiffPage(object):
+ 
+                 def unpack(x):
+                     try:
+-                        return numpy.fromstring(x, typecode)
++                        return numpy.frombuffer(x, typecode)
+                     except ValueError as e:
+                         # strips may be missing EOI
+                         warnings.warn("unpack: %s" % e)
+                         xlen = ((len(x) // (bits_per_sample // 8))
+                                 * (bits_per_sample // 8))
+-                        return numpy.fromstring(x[:xlen], typecode)
++                        return numpy.frombuffer(x[:xlen], typecode)
+ 
+             elif isinstance(bits_per_sample, tuple):
+                 def unpack(x):
+@@ -2724,7 +2724,7 @@ class FileHandle(object):
+             else:
+                 size = count * numpy.dtype(dtype).itemsize
+             data = self._fh.read(size)
+-            return numpy.fromstring(data, dtype, count, sep)
++            return numpy.frombuffer(data, dtype, count, sep)
+ 
+     def read_record(self, dtype, shape=1, byteorder=None):
+         """Return numpy record from file."""
+@@ -2737,7 +2737,7 @@ class FileHandle(object):
+                 shape = self._size // dtype.itemsize
+             size = product(sequence(shape)) * dtype.itemsize
+             data = self._fh.read(size)
+-            return numpy.rec.fromstring(data, dtype, shape,
++            return numpy.rec.frombuffer(data, dtype, shape,
+                                         byteorder=byteorder)
+         return rec[0] if shape == 1 else rec
+ 
+@@ -2800,7 +2800,7 @@ class FileHandle(object):
+ def read_bytes(fh, byteorder, dtype, count):
+     """Read tag data from file and return as byte string."""
+     dtype = 'b' if dtype[-1] == 's' else byteorder+dtype[-1]
+-    return fh.read_array(dtype, count).tostring()
++    return fh.read_array(dtype, count).tobytes()
+ 
+ 
+ def read_numpy(fh, byteorder, dtype, count):
+@@ -3168,7 +3168,7 @@ def imagej_metadata(data, bytecounts, byteorder):
+ 
+     def read_bytes(data, byteorder):
+         #return struct.unpack('b' * len(data), data)
+-        return numpy.fromstring(data, 'uint8')
++        return numpy.frombuffer(data, 'uint8')
+ 
+     metadata_types = {  # big endian
+         b'info': ('info', read_string),
+@@ -3264,7 +3264,7 @@ def decodejpg(encoded, tables=b'', photometric=None,
+     if photometric == 'rgb' and ycbcr_subsampling and ycbcr_positioning:
+         # TODO: convert YCbCr to RGB
+         pass
+-    return image.tostring()
++    return image.tobytes()
+ 
+ 
+ @_replace_by('_tifffile.decodepackbits')
+@@ -3396,7 +3396,7 @@ def unpackints(data, dtype, itemsize, runlen=0):
+ 
+     """
+     if itemsize == 1:  # bitarray
+-        data = numpy.fromstring(data, '|B')
++        data = numpy.frombuffer(data, '|B')
+         data = numpy.unpackbits(data)
+         if runlen % 8:
+             data = data.reshape(-1, runlen + (8 - runlen % 8))
+@@ -3405,7 +3405,7 @@ def unpackints(data, dtype, itemsize, runlen=0):
+ 
+     dtype = numpy.dtype(dtype)
+     if itemsize in (8, 16, 32, 64):
+-        return numpy.fromstring(data, dtype)
++        return numpy.frombuffer(data, dtype)
+     if itemsize < 1 or itemsize > 32:
+         raise ValueError("itemsize out of range: %i" % itemsize)
+     if dtype.kind not in "biu":
+@@ -3481,7 +3481,7 @@ def unpackrgb(data, dtype='<B', bitspersample=(5, 6, 5), rescale=True):
+     if not (bits <= 32 and all(i <= dtype.itemsize*8 for i in bitspersample)):
+         raise ValueError("sample size not supported %s" % str(bitspersample))
+     dt = next(i for i in 'BHI' if numpy.dtype(i).itemsize*8 >= bits)
+-    data = numpy.fromstring(data, dtype.byteorder+dt)
++    data = numpy.frombuffer(data, dtype.byteorder+dt)
+     result = numpy.empty((data.size, len(bitspersample)), dtype.char)
+     for i, bps in enumerate(bitspersample):
+         t = data >> int(numpy.sum(bitspersample[i+1:]))


=====================================
debian/patches/series
=====================================
@@ -1,2 +1,3 @@
 0001-Fix-floating-point-comparison.patch
 0002-Drop-dependeny-on-six.patch
+0003-numpy-2.3-compat.patch



View it on GitLab: https://salsa.debian.org/debian-gis-team/pyninjotiff/-/compare/e8d446866d8be4777621c8885df6fb2d33b999f2...09be7467cc53c36b046393f3125d835f0f472fde

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyninjotiff/-/compare/e8d446866d8be4777621c8885df6fb2d33b999f2...09be7467cc53c36b046393f3125d835f0f472fde
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20250912/8d18eda2/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list