[Git][debian-gis-team/glymur][master] 4 commits: New upstream version 0.14.8

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Mon Jun 1 12:10:00 BST 2026



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


Commits:
aaa83b26 by Antonio Valentino at 2026-06-01T10:58:37+00:00
New upstream version 0.14.8
- - - - -
aaa4a83d by Antonio Valentino at 2026-06-01T10:58:42+00:00
Update upstream source from tag 'upstream/0.14.8'

Update to upstream version '0.14.8'
with Debian dir d4aa3f691b0d58bb0275f67a79180592c99157e0
- - - - -
39b2b4ba by Antonio Valentino at 2026-06-01T11:01:24+00:00
New upstream release

- - - - -
d9d1cc8e by Antonio Valentino at 2026-06-01T11:02:33+00:00
Set distribution to unstable

- - - - -


23 changed files:

- .circleci/config.yml
- CHANGES.txt
- appveyor.yml
- ci/ci-311-np1.yaml
- − ci/ci-311.yaml
- ci/ci-312.yaml
- ci/ci-313.yaml
- ci/ci-314-no-gdal.yaml
- ci/ci-314-no-opj.yaml
- ci/ci-314.yaml
- debian/changelog
- docs/source/conf.py
- docs/source/whatsnew/0.14.rst
- glymur/_iccprofile.py
- glymur/codestream.py
- glymur/core.py
- glymur/jp2box.py
- glymur/tiff.py
- glymur/version.py
- pyproject.toml
- tests/data/misc/issue186_progression_order.txt
- tests/test_colour_specification_box.py
- tests/test_printing.py


Changes:

=====================================
.circleci/config.yml
=====================================
@@ -7,7 +7,6 @@ workflows:
   test:
     jobs:
       - ci-311-np1
-      - ci-311
       - ci-312
       - ci-313
       - ci-314-no-gdal


=====================================
CHANGES.txt
=====================================
@@ -1,3 +1,6 @@
+May 13, 2026 - v0.14.8
+    Fix KeyError on JPH image
+    
 Feb 04, 2026 - v0.14.7
     Refactor image dimension validation
     Refactor codestream parsing


=====================================
appveyor.yml
=====================================
@@ -12,12 +12,6 @@ environment:
 
   matrix:
 
-    - CONDA_ROOT: "C:\\Miniconda3_64"
-      PYTHON_VERSION: "3.11"
-      PYTHON_ARCH: "64"
-      CONDA_PY: "311"
-      USE_PATH_FOR_GDAL_PYTHON: "YES"
-
     - CONDA_ROOT: "C:\\Miniconda3_64"
       PYTHON_VERSION: "3.12"
       PYTHON_ARCH: "64"


=====================================
ci/ci-311-np1.yaml
=====================================
@@ -5,6 +5,7 @@ dependencies:
     - python=3.11.*
     - gdal>=3.8.0,<3.9.0
     - pillow
+    - pip
     - libtiff>=4.6.0,<4.7.0
     - lxml>=5.0
     - numpy<2.0


=====================================
ci/ci-311.yaml deleted
=====================================
@@ -1,13 +0,0 @@
-name: glymur
-channels:
-    - conda-forge
-dependencies:
-    - python=3.11.*
-    - gdal>=3.8.0,<3.9.0
-    - pillow
-    - libtiff>=4.6.0,<4.7.0
-    - lxml>=5.0
-    - numpy>=2.0,<2.1
-    - openjpeg>=2.5
-    - pytest-xdist
-    - scikit-image


=====================================
ci/ci-312.yaml
=====================================
@@ -5,6 +5,7 @@ dependencies:
     - python=3.12.*
     - gdal>=3.8.0,<3.9.0
     - pillow
+    - pip
     - libtiff>=4.7.0,<4.8.0
     - lxml>=5.0.0
     - numpy>=2.0,<2.3


=====================================
ci/ci-313.yaml
=====================================
@@ -6,6 +6,7 @@ dependencies:
     - gdal>=3.10.0,<3.11.0
     - libgdal-jp2openjpeg
     - pillow
+    - pip
     - libtiff>=4.7.0,<4.8.0
     - lxml>=5.3.0,<6.0.0
     - numpy>=2.3,<2.4


=====================================
ci/ci-314-no-gdal.yaml
=====================================
@@ -4,6 +4,7 @@ channels:
 dependencies:
     - python>=3.14.0
     - pillow
+    - pip
     - libtiff>=4.7.1
     - lxml>=6.0.2
     - numpy>=2.3.3


=====================================
ci/ci-314-no-opj.yaml
=====================================
@@ -5,6 +5,7 @@ dependencies:
     - python>=3.14.0
     - gdal>=3.11.0
     - pillow
+    - pip
     - libtiff>=4.7.1
     - lxml>=6.0.2
     - numpy>=2.3.3


=====================================
ci/ci-314.yaml
=====================================
@@ -6,6 +6,7 @@ dependencies:
     - gdal>=3.11.0
     - libgdal-jp2openjpeg
     - pillow
+    - pip
     - libtiff>=4.7.1
     - lxml>=6.0.2
     - numpy>=2.3.3


=====================================
debian/changelog
=====================================
@@ -1,9 +1,12 @@
-glymur (0.14.7-2) UNRELEASED; urgency=medium
+glymur (0.14.8-1) unstable; urgency=medium
 
-  * Team upload.
+  [ Bas Couwenberg ]
   * Bump Standards-Version to 4.7.4, no changes.
 
- -- Bas Couwenberg <sebastic at debian.org>  Sat, 04 Apr 2026 10:11:13 +0200
+  [ Antonio Valentino ]
+  * New upstream release.
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it>  Mon, 01 Jun 2026 11:02:17 +0000
 
 glymur (0.14.7-1) unstable; urgency=medium
 


=====================================
docs/source/conf.py
=====================================
@@ -81,7 +81,7 @@ copyright = '2013-2026, John Evans'
 # The short X.Y version.
 version = '0.14'
 # The full version, including alpha/beta/rc tags.
-release = '0.14.7'
+release = '0.14.8'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.


=====================================
docs/source/whatsnew/0.14.rst
=====================================
@@ -2,6 +2,13 @@
 Changes in glymur 0.14
 ######################
 
+*****************
+Changes in 0.14.8
+*****************
+
+    * Fix KeyError on JPH image
+    * Remove python 3.11 np2.x from CI testing
+
 *****************
 Changes in 0.14.7
 *****************


=====================================
glymur/_iccprofile.py
=====================================
@@ -6,6 +6,9 @@ import struct
 # Third party library imports ...
 import numpy as np
 
+# Local imports
+from .core import _CustomDict
+
 
 class _ICCProfile(object):
     """Container for ICC profile information."""
@@ -48,12 +51,15 @@ class _ICCProfile(object):
         b"FCLR": "15colour",
     }
 
-    rendering_intent_dict = {
+    _items = {
         0: "perceptual",
         1: "media-relative colorimetric",
         2: "saturation",
         3: "ICC-absolute colorimetric",
     }
+    rendering_intent_dict = _CustomDict(
+        _msg_fmt="Unknown value (%s)", _items=_items
+    )
 
     def __init__(self, read_buffer):
         self._raw_buffer = read_buffer
@@ -106,10 +112,7 @@ class _ICCProfile(object):
         header["Device Attributes"] = attr
 
         (rval,) = struct.unpack(">I", read_buffer[64:68])
-        try:
-            header["Rendering Intent"] = self.rendering_intent_dict[rval]
-        except KeyError:
-            header["Rendering Intent"] = "unknown"
+        header["Rendering Intent"] = self.rendering_intent_dict[rval]
 
         data = struct.unpack(">iii", read_buffer[68:80])
         header["Illuminant"] = np.array(data, dtype=np.float64) / 65536


=====================================
glymur/codestream.py
=====================================
@@ -21,22 +21,31 @@ from .core import (
     CPRL,
     WAVELET_XFORM_9X7_IRREVERSIBLE,
     WAVELET_XFORM_5X3_REVERSIBLE,
+    _CustomDict
 )
 from .lib import openjp2 as opj2
 
 
-_PROGRESSION_ORDER_DISPLAY = {
+_items = {
     LRCP: "LRCP",
     RLCP: "RLCP",
     RPCL: "RPCL",
     PCRL: "PCRL",
     CPRL: "CPRL",
 }
+_PROGRESSION_ORDER_DISPLAY = _CustomDict(
+    _msg_fmt="unrecognized progression order value (%s)",
+    _items=_items
+)
 
-_WAVELET_XFORM_DISPLAY = {
-    WAVELET_XFORM_9X7_IRREVERSIBLE: "9-7 irreversible",
-    WAVELET_XFORM_5X3_REVERSIBLE: "5-3 reversible",
+_items = {
+    WAVELET_XFORM_9X7_IRREVERSIBLE: '9-7 irreversible',
+    WAVELET_XFORM_5X3_REVERSIBLE: '5-3 reversible'
 }
+_WAVELET_XFORM_DISPLAY = _CustomDict(
+    _msg_fmt="unrecognized wavelet transform value (%s)",
+    _items=_items
+)
 
 _NO_PROFILE = 0
 _PROFILE_0 = 1
@@ -1167,7 +1176,6 @@ class CODsegment(Segment):
         self.offset = offset
         self.mct = mct
         self.cstyle = cstyle
-        self.xform = xform
 
         self.layers = num_layers
         self._numresolutions = nr
@@ -1187,6 +1195,7 @@ class CODsegment(Segment):
         ]:
             msg = f"Invalid wavelet transform in COD segment: {xform}."
             warnings.warn(msg, UserWarning)
+        self.xform = xform
 
         self.code_block_size = 4 * 2**ycb, 4 * 2**xcb
 
@@ -1224,14 +1233,9 @@ class CODsegment(Segment):
         else:
             mct_str = "unknown"
 
-        try:
-            progression_order = _PROGRESSION_ORDER_DISPLAY[self.prog_order]
-        except KeyError:
-            progression_order = f"{self.prog_order} (invalid)"
-        try:
-            xform = _WAVELET_XFORM_DISPLAY[self.xform]
-        except KeyError:
-            xform = f"{self.xform} (invalid)"
+        progression_order = _PROGRESSION_ORDER_DISPLAY[self.prog_order]
+        xform = _WAVELET_XFORM_DISPLAY[self.xform]
+
         msg = msg.format(
             with_without="with" if (self.scod & 1) else "without",
             sop=((self.scod & 2) > 0),
@@ -1412,10 +1416,7 @@ class PODsegment(Segment):
         )
         for j in range(len(self.rspod)):
 
-            try:
-                progorder = _PROGRESSION_ORDER_DISPLAY[self.ppod[j]]
-            except KeyError:
-                progorder = f"invalid value: {self.ppod[j]}"
+            progorder = _PROGRESSION_ORDER_DISPLAY[self.ppod[j]]
 
             msg += submsg.format(
                 j,


=====================================
glymur/core.py
=====================================
@@ -1,5 +1,24 @@
 """Core definitions to be shared amongst the modules."""
 
+
+class _CustomDict(dict):
+    """
+    Use this instead of a normal dictionary when we need a custom message
+    printed instead of dealing with a KeyError.
+    """
+
+    def __init__(self, *args, _msg_fmt='', _items=None):
+        dict.__init__(self, *args)
+        self._msg_fmt = _msg_fmt
+
+        if _items is not None:
+            for key, value in _items.items():
+                self.__setitem__(key, value)
+
+    def __missing__(self, key):
+        return self._msg_fmt % key
+
+
 # Progression order
 LRCP = 0
 RLCP = 1
@@ -101,7 +120,7 @@ E_SRGB = 20
 ROMM_RGB = 21
 
 
-_COLORSPACE_MAP_DISPLAY = {
+_items = {
     CMYK: "CMYK",
     SRGB: "sRGB",
     GREYSCALE: "greyscale",
@@ -109,6 +128,10 @@ _COLORSPACE_MAP_DISPLAY = {
     E_SRGB: "e-sRGB",
     ROMM_RGB: "ROMM-RGB",
 }
+_COLORSPACE_MAP_DISPLAY = _CustomDict(
+    _msg_fmt="unrecognized value (%s)",
+    _items=_items
+)
 
 # enumerated color channel types
 COLOR = 0
@@ -117,12 +140,16 @@ PRE_MULTIPLIED_OPACITY = 2
 _UNSPECIFIED = 65535
 
 
-_COLOR_TYPE_MAP_DISPLAY = {
+_items = {
     COLOR: "color",
     OPACITY: "opacity",
     PRE_MULTIPLIED_OPACITY: "pre-multiplied opacity",
     _UNSPECIFIED: "unspecified",
 }
+_COLOR_TYPE_MAP_DISPLAY = _CustomDict(
+    _msg_fmt="unrecognized value (%s)",
+    _items=_items
+)
 
 # color channel definitions.
 RED = 1


=====================================
glymur/jp2box.py
=====================================
@@ -50,27 +50,35 @@ from .core import (
     RESTRICTED_ICC_PROFILE,
     ANY_ICC_PROFILE,
     VENDOR_COLOR_METHOD,
+    _CustomDict
 )
 from .lib._tiff import tiff_header, BadTiffTagDatatype
 from . import get_option
 from ._iccprofile import _ICCProfile
 
 
-_COLORSPACE_METHODS = {
+_items = {
     ENUMERATED_COLORSPACE: "enumerated colorspace",
     RESTRICTED_ICC_PROFILE: "restricted ICC profile",
     ANY_ICC_PROFILE: "any ICC profile",
     VENDOR_COLOR_METHOD: "vendor color method",
 }
+_COLORSPACE_METHODS = _CustomDict(
+    _msg_fmt="unrecognized colorspace value (%s)",
+    _items=_items
+)
 
-
-_APPROXIMATION_MEASURES = {
+_items = {
     0: "JP2 only",
     1: "accurately represents correct colorspace definition",
     2: "approximates correct colorspace definition, exceptional quality",
     3: "approximates correct colorspace definition, reasonable quality",
     4: "approximates correct colorspace definition, poor quality",
 }
+_APPROXIMATION_MEASURES = _CustomDict(
+    _msg_fmt="unrecognized approximation measure value (%s)",
+    _items=_items
+)
 
 # Three different UUIDs are given special treatment.
 _GEOTIFF_UUID = UUID("b14bf8bd-083d-4b43-a5ae-8cd7d5a6ce03")
@@ -434,29 +442,19 @@ class ColourSpecificationBox(Jp2kBox):
 
         lst = []
 
-        try:
-            item = _COLORSPACE_METHODS[self.method]
-        except KeyError:
-            item = f"unrecognized value ({self.method})"
-        text = f"Method:  {item}"
-
+        text = f"Method:  {_COLORSPACE_METHODS[self.method]}"
         lst.append(text)
+
         text = f"Precedence:  {self.precedence}"
         lst.append(text)
 
         if self.approximation != 0:
-            try:
-                dispvalue = _APPROXIMATION_MEASURES[self.approximation]
-            except KeyError:
-                dispvalue = f"invalid ({self.approximation})"
+            dispvalue = _APPROXIMATION_MEASURES[self.approximation]
             text = f"Approximation:  {dispvalue}"
             lst.append(text)
 
         if self.colorspace is not None:
-            try:
-                dispvalue = _COLORSPACE_MAP_DISPLAY[self.colorspace]
-            except KeyError:
-                dispvalue = f"{self.colorspace} (unrecognized)"
+            dispvalue = _COLORSPACE_MAP_DISPLAY[self.colorspace]
             text = f"Colorspace:  {dispvalue}"
         else:
             if self.icc_profile is None:
@@ -631,10 +629,7 @@ class ChannelDefinitionBox(Jp2kBox):
         for association, channel_type, index in zip(
             self.association, self.channel_type, self.index
         ):
-            try:
-                color_type_string = _COLOR_TYPE_MAP_DISPLAY[channel_type]
-            except KeyError:
-                color_type_string = f"invalid ({channel_type})"
+            color_type_string = _COLOR_TYPE_MAP_DISPLAY[channel_type]
 
             association = str(association) if association else "whole image"
             text = f"Channel {index} ({color_type_string}) ==> ({association})"


=====================================
glymur/tiff.py
=====================================
@@ -175,8 +175,7 @@ class Tiff2Jp2k(_2JP2Converter):
                 try:
                     tag_num = TAGNAME2NUM[tag]
                 except KeyError:
-                    msg = f"{tag} is not a recognized TIFF tag"
-                    warnings.warn(msg)
+                    warnings.warn(f"{tag} is not a recognized TIFF tag")
                 else:
                     lst.append(tag_num)
             else:


=====================================
glymur/version.py
=====================================
@@ -20,7 +20,7 @@ from .lib import _tiff as tiff
 
 # Do not change the format of this next line!  Doing so risks breaking
 # setup.py
-version = "0.14.7"
+version = "0.14.8"
 
 version_tuple = parse(version).release
 


=====================================
pyproject.toml
=====================================
@@ -22,7 +22,7 @@ license = 'MIT'
 name = 'Glymur'
 readme = 'README.md'
 requires-python = '>=3.11'
-version = '0.14.7'
+version = '0.14.8'
 
 [project.scripts]
 jp2dump = 'glymur.command_line:main'


=====================================
tests/data/misc/issue186_progression_order.txt
=====================================
@@ -4,7 +4,7 @@ COD marker segment @ (174, 12)
         SOP marker segments:  False
         EPH marker segments:  False
     Coding style parameters:
-        Progression order:  33 (invalid)
+        Progression order:  unrecognized progression order value (33)
         Number of layers:  1
         Multiple component transformation usage:  reversible
         Number of decomposition levels:  5


=====================================
tests/test_colour_specification_box.py
=====================================
@@ -172,7 +172,9 @@ class TestSuite(unittest.TestCase):
         self.buffer = self.buffer[:64] + intent + self.buffer[68:]
 
         icc_profile = _ICCProfile(self.buffer)
-        self.assertEqual(icc_profile.header["Rendering Intent"], "unknown")
+        self.assertEqual(
+            icc_profile.header["Rendering Intent"], "Unknown value (10)"
+        )
 
     def test_version4(self):
         """


=====================================
tests/test_printing.py
=====================================
@@ -18,7 +18,7 @@ import numpy as np
 import lxml.etree as ET
 
 import glymur
-from glymur.codestream import LRCP, WAVELET_XFORM_5X3_REVERSIBLE
+from glymur.codestream import LRCP, WAVELET_XFORM_5X3_REVERSIBLE, COCsegment
 from glymur.core import COLOR, RED, GREEN, BLUE, RESTRICTED_ICC_PROFILE
 from glymur.jp2box import BitsPerComponentBox, ColourSpecificationBox
 from glymur.jp2box import LabelBox, UUIDBox
@@ -322,8 +322,9 @@ class TestPrinting(fixtures.TestCommon):
         expected = ("Colour Specification Box (colr) @ (-1, 0)\n"
                     "    Method:  enumerated colorspace\n"
                     "    Precedence:  2\n"
-                    "    Approximation:  invalid (32)\n"
-                    "    Colorspace:  1 (unrecognized)")
+                    "    Approximation:  "
+                    "unrecognized approximation measure value (32)\n"
+                    "    Colorspace:  unrecognized value (1)")
         self.assertEqual(actual, expected)
 
     def test_invalid_colorspace(self):
@@ -1173,7 +1174,8 @@ class TestPrinting(fixtures.TestCommon):
             '        Layer index end:  1\n'
             '        Resolution index end:  33\n'
             '        Component index end:  257\n'
-            '        Progression order:  invalid value: 16'
+            '        Progression order:  '
+            'unrecognized progression order value (16)'
         )
 
         self.assertEqual(actual, expected)
@@ -1654,6 +1656,17 @@ class TestPrinting(fixtures.TestCommon):
         )
         self.assertEqual(actual, expected)
 
+    def test_coc_segment_with_unrecognized_wavelet_transform(self):
+        """
+        Scenario:  Print a COC segment that has an unrecognized wavelet
+        transform.
+
+        Expected Result:  should not error out
+        """
+        spcoc = np.array([129, 6, 1, 72, 2, 45, 45, 45, 45, 61, 77])
+        coc = COCsegment(0, 1, spcoc, -1, -1)
+        str(coc)
+
 
 class TestJp2dump(fixtures.TestCommon):
     """Tests for verifying how jp2dump console script works."""



View it on GitLab: https://salsa.debian.org/debian-gis-team/glymur/-/compare/01bf8e868d9c4e4610fff42b58918a8d15bd8126...d9d1cc8ec37c921b4189984e1a96c517fcc96c2a

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/glymur/-/compare/01bf8e868d9c4e4610fff42b58918a8d15bd8126...d9d1cc8ec37c921b4189984e1a96c517fcc96c2a
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


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


More information about the Pkg-grass-devel mailing list