Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-Glymur for openSUSE:Factory checked in at 2026-03-16 14:16:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Glymur (Old) and /work/SRC/openSUSE:Factory/.python-Glymur.new.8177 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Glymur" Mon Mar 16 14:16:43 2026 rev:17 rq:1339136 version:0.14.7 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Glymur/python-Glymur.changes 2025-11-21 16:57:38.728805547 +0100 +++ /work/SRC/openSUSE:Factory/.python-Glymur.new.8177/python-Glymur.changes 2026-03-16 14:19:50.503543711 +0100 @@ -1,0 +2,8 @@ +Sun Mar 15 18:51:15 UTC 2026 - Dirk Müller <[email protected]> + +- update to 0.14.7: + * Refactor image dimension validation + * Refactor codestream parsing + * Fix numpy 2.5 deprecation issue + +------------------------------------------------------------------- Old: ---- Glymur-0.14.4.tar.gz New: ---- Glymur-0.14.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Glymur.spec ++++++ --- /var/tmp/diff_new_pack.cZc79k/_old 2026-03-16 14:19:50.999564302 +0100 +++ /var/tmp/diff_new_pack.cZc79k/_new 2026-03-16 14:19:51.003564468 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-Glymur # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-Glymur -Version: 0.14.4 +Version: 0.14.7 Release: 0 Summary: Tools for accessing JPEG2000 files License: MIT ++++++ Glymur-0.14.4.tar.gz -> Glymur-0.14.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/.circleci/config.yml new/glymur-0.14.7/.circleci/config.yml --- old/glymur-0.14.4/.circleci/config.yml 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/.circleci/config.yml 2026-02-04 00:44:23.000000000 +0100 @@ -6,12 +6,13 @@ version: 2 test: jobs: - - travis-311-no-gdal - - travis-311-no-opj - - travis-311 - - travis-312 - - travis-313 - - travis-314 + - ci-311-np1 + - ci-311 + - ci-312 + - ci-313 + - ci-314-no-gdal + - ci-314-no-opj + - ci-314 test-template: &test-template docker: @@ -47,20 +48,23 @@ pytest --doctest-modules glymur jobs: - travis-311-no-gdal: + ci-311-np1: <<: *test-template - travis-311-no-opj: + ci-311: <<: *test-template - travis-311: + ci-312: <<: *test-template - travis-312: + ci-313: <<: *test-template - travis-313: + ci-314-no-gdal: <<: *test-template - travis-314: + ci-314-no-opj: + <<: *test-template + + ci-314: <<: *test-template diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/CHANGES.txt new/glymur-0.14.7/CHANGES.txt --- old/glymur-0.14.4/CHANGES.txt 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/CHANGES.txt 2026-02-04 00:44:23.000000000 +0100 @@ -1,3 +1,10 @@ +Feb 04, 2026 - v0.14.7 + Refactor image dimension validation + Refactor codestream parsing + +Jan 26, 2026 - v0.14.6 + Fix numpy 2.5 deprecation issue + Oct 08, 2025 - v0.14.4 Qualify on python 3.14 Add User-Agent header to powershell script for Appveyor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/appveyor.yml new/glymur-0.14.7/appveyor.yml --- old/glymur-0.14.4/appveyor.yml 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/appveyor.yml 2026-02-04 00:44:23.000000000 +0100 @@ -71,7 +71,7 @@ - cmd: conda info -a # create our env - - SET REQ=ci\travis-%CONDA_PY%.yaml + - SET REQ=ci\ci-%CONDA_PY%.yaml - cmd: echo "installing requirements from %REQ%" - cmd: conda env create --file=%REQ% - cmd: conda list -n glymur diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/azure-pipelines.yml new/glymur-0.14.7/azure-pipelines.yml --- old/glymur-0.14.4/azure-pipelines.yml 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/azure-pipelines.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,30 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -trigger: -- master - -pool: - vmImage: ubuntu-latest -strategy: - matrix: - Python37: - python.version: '3.7' - -steps: -- task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - displayName: 'Use Python $(python.version)' - -- script: | - python -m pip install --upgrade pip - pip install -r requirements.txt - displayName: 'Install dependencies' - -- script: | - pip install pytest pytest-azurepipelines - pytest - displayName: 'pytest' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/ci-311-np1.yaml new/glymur-0.14.7/ci/ci-311-np1.yaml --- old/glymur-0.14.4/ci/ci-311-np1.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/glymur-0.14.7/ci/ci-311-np1.yaml 2026-02-04 00:44:23.000000000 +0100 @@ -0,0 +1,13 @@ +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 + - openjpeg>=2.5 + - pytest-xdist + - scikit-image diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/ci-311.yaml new/glymur-0.14.7/ci/ci-311.yaml --- old/glymur-0.14.4/ci/ci-311.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/glymur-0.14.7/ci/ci-311.yaml 2026-02-04 00:44:23.000000000 +0100 @@ -0,0 +1,13 @@ +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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/ci-312.yaml new/glymur-0.14.7/ci/ci-312.yaml --- old/glymur-0.14.4/ci/ci-312.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/glymur-0.14.7/ci/ci-312.yaml 2026-02-04 00:44:23.000000000 +0100 @@ -0,0 +1,13 @@ +name: glymur +channels: + - conda-forge +dependencies: + - python=3.12.* + - gdal>=3.8.0,<3.9.0 + - pillow + - libtiff>=4.7.0,<4.8.0 + - lxml>=5.0.0 + - numpy>=2.0,<2.3 + - openjpeg>=2.5 + - pytest-xdist + - scikit-image diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/ci-313.yaml new/glymur-0.14.7/ci/ci-313.yaml --- old/glymur-0.14.4/ci/ci-313.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/glymur-0.14.7/ci/ci-313.yaml 2026-02-04 00:44:23.000000000 +0100 @@ -0,0 +1,14 @@ +name: glymur +channels: + - conda-forge +dependencies: + - python=3.13.* + - gdal>=3.10.0,<3.11.0 + - libgdal-jp2openjpeg + - pillow + - libtiff>=4.7.0,<4.8.0 + - lxml>=5.3.0,<6.0.0 + - numpy>=2.3,<2.4 + - openjpeg>=2.5.3,<2.5.4 + - pytest-xdist + - scikit-image diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/ci-314-no-gdal.yaml new/glymur-0.14.7/ci/ci-314-no-gdal.yaml --- old/glymur-0.14.4/ci/ci-314-no-gdal.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/glymur-0.14.7/ci/ci-314-no-gdal.yaml 2026-02-04 00:44:23.000000000 +0100 @@ -0,0 +1,13 @@ +name: glymur +channels: + - conda-forge +dependencies: + - python>=3.14.0 + - pillow + - libtiff>=4.7.1 + - lxml>=6.0.2 + - numpy>=2.3.3 + - openjpeg>=2.5.4 + - pip + - pytest-xdist + - scikit-image diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/ci-314-no-opj.yaml new/glymur-0.14.7/ci/ci-314-no-opj.yaml --- old/glymur-0.14.4/ci/ci-314-no-opj.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/glymur-0.14.7/ci/ci-314-no-opj.yaml 2026-02-04 00:44:23.000000000 +0100 @@ -0,0 +1,13 @@ +name: glymur +channels: + - conda-forge +dependencies: + - python>=3.14.0 + - gdal>=3.11.0 + - pillow + - libtiff>=4.7.1 + - lxml>=6.0.2 + - numpy>=2.3.3 + - pip + - pytest-xdist + - scikit-image diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/ci-314.yaml new/glymur-0.14.7/ci/ci-314.yaml --- old/glymur-0.14.4/ci/ci-314.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/glymur-0.14.7/ci/ci-314.yaml 2026-02-04 00:44:23.000000000 +0100 @@ -0,0 +1,14 @@ +name: glymur +channels: + - conda-forge +dependencies: + - python>=3.14.0 + - gdal>=3.11.0 + - libgdal-jp2openjpeg + - pillow + - libtiff>=4.7.1 + - lxml>=6.0.2 + - numpy>=2.3.3 + - openjpeg>=2.5.4 + - pytest-xdist + - scikit-image diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/travis-311-no-gdal.yaml new/glymur-0.14.7/ci/travis-311-no-gdal.yaml --- old/glymur-0.14.4/ci/travis-311-no-gdal.yaml 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/ci/travis-311-no-gdal.yaml 1970-01-01 01:00:00.000000000 +0100 @@ -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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/travis-311-no-opj.yaml new/glymur-0.14.7/ci/travis-311-no-opj.yaml --- old/glymur-0.14.4/ci/travis-311-no-opj.yaml 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/ci/travis-311-no-opj.yaml 1970-01-01 01:00:00.000000000 +0100 @@ -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 - - pip - - pytest-xdist - - scikit-image diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/travis-311.yaml new/glymur-0.14.7/ci/travis-311.yaml --- old/glymur-0.14.4/ci/travis-311.yaml 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/ci/travis-311.yaml 1970-01-01 01:00:00.000000000 +0100 @@ -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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/travis-312.yaml new/glymur-0.14.7/ci/travis-312.yaml --- old/glymur-0.14.4/ci/travis-312.yaml 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/ci/travis-312.yaml 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -name: glymur -channels: - - conda-forge -dependencies: - - python=3.12.* - - gdal>=3.8.0,<3.9.0 - - pillow - - libtiff>=4.7.0,<4.8.0 - - lxml>=5.0.0 - - numpy>=2.0 - - openjpeg>=2.5 - - pytest-xdist - - scikit-image diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/travis-313.yaml new/glymur-0.14.7/ci/travis-313.yaml --- old/glymur-0.14.4/ci/travis-313.yaml 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/ci/travis-313.yaml 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -name: glymur -channels: - - conda-forge -dependencies: - - python=3.13.* - - gdal>=3.10.0,<3.11.0 - - pillow - - libtiff>=4.7.0,<4.8.0 - - lxml>=5.3.0,<6.0.0 - - numpy>=2.1,<2.3.3 - - openjpeg>=2.5.3,<2.5.4 - - pytest-xdist - - scikit-image diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/ci/travis-314.yaml new/glymur-0.14.7/ci/travis-314.yaml --- old/glymur-0.14.4/ci/travis-314.yaml 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/ci/travis-314.yaml 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -name: glymur -channels: - - conda-forge -dependencies: - - python>=3.14.0 - - gdal>=3.11.0 - - pillow - - libtiff>=4.7.1 - - lxml>=6.0.2 - - numpy>=2.3.3 - - openjpeg>=2.5.4 - - pytest-xdist - - scikit-image diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/docs/source/conf.py new/glymur-0.14.7/docs/source/conf.py --- old/glymur-0.14.4/docs/source/conf.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/docs/source/conf.py 2026-02-04 00:44:23.000000000 +0100 @@ -72,7 +72,7 @@ # General information about the project. project = 'glymur' -copyright = '2013-2025, John Evans' +copyright = '2013-2026, John Evans' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -81,7 +81,7 @@ # The short X.Y version. version = '0.14' # The full version, including alpha/beta/rc tags. -release = '0.14.4' +release = '0.14.7' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/docs/source/whatsnew/0.14.rst new/glymur-0.14.7/docs/source/whatsnew/0.14.rst --- old/glymur-0.14.4/docs/source/whatsnew/0.14.rst 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/docs/source/whatsnew/0.14.rst 2026-02-04 00:44:23.000000000 +0100 @@ -3,6 +3,36 @@ ###################### ***************** +Changes in 0.14.7 +***************** + + * Refactor image dimension validation + * Refactor codestream parsing + * Update CI numpy specs + * Add CI workflow for numpy<2.0 + + +***************** +Changes in 0.14.6 +***************** + + * Fix numpy 2.5 deprecation warning + +***************** +Changes in 0.14.5 +***************** + + * Suppress W291 warning from doctests + * Remove two debugging breakpoints + * Update CI infrastructure for names + * Update testing, deprecate python 3.11 + * Use importlib.resources instead of importlib.metadata + * Remove custom chdir context manager + * Use sys.version() to determine if anaconda or not on tests + * Add libgdal-jp2openjpeg to CI + * Remove broken azure pipelines setup + +***************** Changes in 0.14.4 ***************** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/glymur/_core_converter.py new/glymur-0.14.7/glymur/_core_converter.py --- old/glymur-0.14.4/glymur/_core_converter.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/glymur/_core_converter.py 2026-02-04 00:44:23.000000000 +0100 @@ -276,11 +276,7 @@ b.seek(tag_offset) - try: - dtype = tags[tag]["dtype"] - except IndexError: - breakpoint() - pass + dtype = tags[tag]["dtype"] nvalues = tags[tag]["nvalues"] payload = tags[tag]["payload"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/glymur/jp2box.py new/glymur-0.14.7/glymur/jp2box.py --- old/glymur-0.14.4/glymur/jp2box.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/glymur/jp2box.py 2026-02-04 00:44:23.000000000 +0100 @@ -2,11 +2,11 @@ References ---------- -.. [JP2K15444-1i] International Organization for Standardication. ISO/IEC +.. [JP2K15444-1i] International Organization for Standardization. ISO/IEC 15444-1:2004 - Information technology -- JPEG 2000 image coding system: Core coding system -.. [JP2K15444-2m] International Organization for Standardication. ISO/IEC +.. [JP2K15444-2m] International Organization for Standardization. ISO/IEC 15444-2:2004 - Information technology -- JPEG 2000 image coding system: Extensions """ @@ -1065,7 +1065,7 @@ offset=-1 ): super().__init__() - self._codestream = codestream + self.codestream = codestream self.length = length self.offset = offset self.main_header_offset = main_header_offset @@ -1073,24 +1073,6 @@ # The filename can be set if lazy loading is desired. self._filename = None - @property - def codestream(self): - if get_option("parse.full_codestream") is True: - header_only = False - else: - header_only = True - if self._codestream is None: - if self._filename is not None: - with open(self._filename, "rb") as fptr: - fptr.seek(self.main_header_offset) - self._codestream = Codestream( - fptr, - self.length, - header_only=header_only - ) - - return self._codestream - def __repr__(self): msg = "glymur.jp2box.ContiguousCodeStreamBox" msg += f"(codestream={repr(self.codestream)})" @@ -1134,7 +1116,7 @@ if get_option("parse.full_codestream"): codestream = Codestream(fptr, length, header_only=False) else: - codestream = None + codestream = Codestream(fptr, length, header_only=True) box = cls( codestream, main_header_offset=main_header_offset, @@ -3555,7 +3537,7 @@ References ---------- - .. [XMP] International Organization for Standardication. ISO/IEC + .. [XMP] International Organization for Standardization. ISO/IEC 16684-1:2012 - Graphic technology -- Extensible metadata platform (XMP) specification -- Part 1: Data model, serialization and core properties """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/glymur/jp2k.py new/glymur-0.14.7/glymur/jp2k.py --- old/glymur-0.14.4/glymur/jp2k.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/glymur/jp2k.py 2026-02-04 00:44:23.000000000 +0100 @@ -741,6 +741,7 @@ Examples -------- + # noqa : W291 >>> import io, shutil, lxml.etree as ET >>> _ = shutil.copyfile(glymur.data.nemo(), 'new-nemo.jp2') >>> j = glymur.Jp2k('new-nemo.jp2') @@ -1078,8 +1079,9 @@ else: numrows, numcols, num_comps = self.shape - for k in range(num_comps): - self._validate_nonzero_image_size(numrows, numcols, k) + if 0 in imgdata.shape: + msg = f"The image has invalid dimensions, {imgdata.shape}." + raise InvalidJp2kError(msg) # set image offset and reference grid image.contents.x0 = self._cparams.image_offset_x0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/glymur/jp2kr.py new/glymur-0.14.7/glymur/jp2kr.py --- old/glymur-0.14.4/glymur/jp2kr.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/glymur/jp2kr.py 2026-02-04 00:44:23.000000000 +0100 @@ -395,7 +395,6 @@ """ .. deprecated:: 0.15.0 """ - breakpoint() msg = "Deprecated, do not use." warnings.warn(msg, DeprecationWarning) self._parse(force=force) @@ -456,6 +455,13 @@ # boxes) here. fptr.seek(0) self.box = self.parse_superbox(fptr) + + # Set the codestream property if it is there. Do this now because + # the validation process would otherwise cause another file-open to + # occur and re-parse the codestream (if it exists). + jp2c = next(filter(lambda x: x.box_id == 'jp2c', self.box), None) + self._codestream = jp2c.codestream if jp2c is not None else None + self._validate() self._parse_count += 1 @@ -927,7 +933,14 @@ for k in range(raw_image.contents.numcomps): component = raw_image.contents.comps[k] - self._validate_nonzero_image_size(nrows[k], ncols[k], k) + # validate the image size + if nrows[k] == 0 or ncols[k] == 0: + # Letting this situation continue would segfault openjpeg. + msg = ( + f"Component {k} has invalid dimensions, " + f"{nrows[k]} x {ncols[k]}" + ) + raise InvalidJp2kError(msg) addr = ctypes.addressof(component.data.contents) with warnings.catch_warnings(): @@ -948,7 +961,7 @@ if is_cube and image.shape[2] == 1: # The third dimension has just a single layer. Make the image # data 2D instead of 3D. - image.shape = image.shape[0:2] + image = np.reshape(image, image.shape[0:2]) return image @@ -985,10 +998,6 @@ def get_codestream(self, header_only=True): """Retrieve codestream. - This differs from the codestream property in that segment - metadata that lies past the end of the codestream header - can be retrieved. - Parameters ---------- header_only : bool, optional @@ -1024,50 +1033,37 @@ # if it's just a raw codestream file, it's easy if self._codec_format == opj2.CODEC_J2K: - return self._get_codestream(fptr, self.length, header_only) - - # continue assuming JP2, must seek to the JP2C box and past its - # header - box = next(filter(lambda x: x.box_id == "jp2c", self.box), None) - - fptr.seek(box.offset) - read_buffer = fptr.read(8) - (box_length, _) = struct.unpack(">I4s", read_buffer) - if box_length == 0: - # The length of the box is presumed to last until the end - # of the file. Compute the effective length of the box. - box_length = self.path.stat().st_size - fptr.tell() + 8 - elif box_length == 1: - # Seek past the XL field. - read_buffer = fptr.read(8) - (box_length,) = struct.unpack(">Q", read_buffer) - - return self._get_codestream(fptr, box_length - 8, header_only) - - def _get_codestream(self, fptr, length, header_only): - """ - Parsing errors can make for confusing errors sometimes, so catch any - such error and add context to it. - """ + length = self.length + else: - try: - codestream = Codestream(fptr, length, header_only=header_only) - except Exception: - _, value, traceback = sys.exc_info() - msg = ( - f"The file is invalid " - f'because the codestream could not be parsed: "{value}"' - ) - raise InvalidJp2kError(msg).with_traceback(traceback) - else: - return codestream + # continue assuming JP2, must seek to the JP2C box and past its + # header + box = next( + filter(lambda x: x.box_id == "jp2c", self.box), + None + ) - def _validate_nonzero_image_size(self, nrows, ncols, component_index): - """The image cannot have area of zero.""" - if nrows == 0 or ncols == 0: - # Letting this situation continue would segfault openjpeg. - msg = ( - f"Component {component_index} has dimensions " - f"{nrows} x {ncols}" - ) - raise InvalidJp2kError(msg) + fptr.seek(box.offset) + read_buffer = fptr.read(8) + (box_length, _) = struct.unpack(">I4s", read_buffer) + if box_length == 0: + # The length of the box is presumed to last until the end + # of the file. Compute the effective length of the box. + box_length = self.path.stat().st_size - fptr.tell() + 8 + elif box_length == 1: + # Seek past the XL field. + read_buffer = fptr.read(8) + (box_length,) = struct.unpack(">Q", read_buffer) + length = box_length - 8 + + try: + codestream = Codestream(fptr, length, header_only=header_only) + except Exception: + _, value, traceback = sys.exc_info() + msg = ( + f"The file is invalid " + f'because the codestream could not be parsed: "{value}"' + ) + raise InvalidJp2kError(msg).with_traceback(traceback) + else: + return codestream diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/glymur/version.py new/glymur-0.14.7/glymur/version.py --- old/glymur-0.14.4/glymur/version.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/glymur/version.py 2026-02-04 00:44:23.000000000 +0100 @@ -20,7 +20,7 @@ # Do not change the format of this next line! Doing so risks breaking # setup.py -version = "0.14.4" +version = "0.14.7" version_tuple = parse(version).release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/pyproject.toml new/glymur-0.14.7/pyproject.toml --- old/glymur-0.14.4/pyproject.toml 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/pyproject.toml 2026-02-04 00:44:23.000000000 +0100 @@ -22,7 +22,7 @@ name = 'Glymur' readme = 'README.md' requires-python = '>=3.11' -version = '0.14.4' +version = '0.14.7' [project.scripts] jp2dump = 'glymur.command_line:main' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/tests/fixtures.py new/glymur-0.14.7/tests/fixtures.py --- old/glymur-0.14.4/tests/fixtures.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/tests/fixtures.py 2026-02-04 00:44:23.000000000 +0100 @@ -3,21 +3,18 @@ """ # Standard library imports -import importlib.metadata as im +import importlib.resources as ir import pathlib -import platform import shutil import sys import tempfile import unittest # are we anaconda? -try: - import conda # noqa : F401 -except ImportError: - ANACONDA = False -else: +if 'conda' in sys.version.lower(): ANACONDA = True +else: + ANACONDA = False # are we macports? if sys.executable.startswith('/opt/local/Library/Frameworks/Python.framework'): @@ -25,20 +22,6 @@ else: MACPORTS = False -# are we a linux platform that can use importlib.metadata -if ( - platform.system() == 'linux' - and platform.freedesktop_os_release()['id'] == 'opensuse-tumbleweed' -): - LINUX_WITH_GOOD_IMPORTLIBMETADATA = True -else: - LINUX_WITH_GOOD_IMPORTLIBMETADATA = False - -if ANACONDA or MACPORTS or LINUX_WITH_GOOD_IMPORTLIBMETADATA: - CANNOT_USE_IMPORTLIB_METADATA = False -else: - CANNOT_USE_IMPORTLIB_METADATA = True - # 3rd party library imports try: from osgeo import gdal # noqa : F401 @@ -107,22 +90,9 @@ Use some files supplied by scikit-image for our tests. """ - files = im.files('scikit-image') - - jpeg = next(filter(lambda x: 'retina' in x.name, files), None) - cls.retina = jpeg.locate() - - jpeg = next( - filter(lambda x: 'hubble_deep_field' in x.name, files), - None - ) - cls.hubble = jpeg.locate() - - jpeg = next( - filter(lambda x: 'rocket' in x.name, files), - None - ) - cls.rocket = jpeg.locate() + cls.retina = ir.files('skimage') / 'data' / 'retina.jpg' + cls.hubble = ir.files('skimage') / 'data' / 'hubble_deep_field.jpg' + cls.rocket = ir.files('skimage') / 'data' / 'rocket.jpg' def setUp(self): super().setUp() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/tests/test_commandline_jpeg2jp2.py new/glymur-0.14.7/tests/test_commandline_jpeg2jp2.py --- old/glymur-0.14.4/tests/test_commandline_jpeg2jp2.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/tests/test_commandline_jpeg2jp2.py 2026-02-04 00:44:23.000000000 +0100 @@ -13,16 +13,11 @@ from . import fixtures from .fixtures import ( OPENJPEG_NOT_AVAILABLE, - OPENJPEG_NOT_AVAILABLE_MSG, - CANNOT_USE_IMPORTLIB_METADATA + OPENJPEG_NOT_AVAILABLE_MSG ) @unittest.skipIf(OPENJPEG_NOT_AVAILABLE, OPENJPEG_NOT_AVAILABLE_MSG) [email protected]( - CANNOT_USE_IMPORTLIB_METADATA, - 'missing importlib.metadata.files ?' -) class TestSuite(fixtures.TestJPEGCommon): def test_smoke(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/tests/test_config.py new/glymur-0.14.7/tests/test_config.py --- old/glymur-0.14.4/tests/test_config.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/tests/test_config.py 2026-02-04 00:44:23.000000000 +0100 @@ -5,7 +5,6 @@ # Standard library imports ... import contextlib import importlib -import os import pathlib import platform import unittest @@ -18,26 +17,6 @@ from .fixtures import TestCommon, OPENJPEG_NOT_AVAILABLE, OPENJPEG_NOT_AVAILABLE_MSG # noqa : E501 [email protected] -def chdir(dirname=None): - """ - This context manager restores the value of the current working directory - (cwd) after the enclosed code block completes or raises an exception. If a - directory name is supplied to the context manager then the cwd is changed - prior to running the code block. - - Shamelessly lifted from - http://www.astropython.org/snippet/2009/10/chdir-context-manager - """ - curdir = os.getcwd() - try: - if dirname is not None: - os.chdir(dirname) - yield - finally: - os.chdir(curdir) - - @patch("glymur.config.glymurrc_fname", lambda: None) class TestSuitePathToLibrary(TestCommon): """ @@ -331,7 +310,7 @@ f.write("[library]\n") f.write(f"openjp2: {expected}\n") - with chdir(self.glymur_configdir): + with contextlib.chdir(self.glymur_configdir): # Should be able to load openjp2 as before. actual = glymur.config.read_config_file("openjp2") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/tests/test_jp2k.py new/glymur-0.14.7/tests/test_jp2k.py --- old/glymur-0.14.4/tests/test_jp2k.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/tests/test_jp2k.py 2026-02-04 00:44:23.000000000 +0100 @@ -1056,10 +1056,7 @@ glymur.set_option("parse.full_codestream", False) def test_main_header(self): - """verify that the main header isn't loaded during normal parsing""" - # The hidden _main_header attribute should show up after accessing it. + """verify that the main header is loaded during normal parsing""" jp2 = Jp2k(self.jp2file) jp2c = jp2.box[3] - self.assertIsNone(jp2c._codestream) - jp2c.codestream - self.assertIsNotNone(jp2c._codestream) + self.assertIsNotNone(jp2c.codestream) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/tests/test_jp2kr.py new/glymur-0.14.7/tests/test_jp2kr.py --- old/glymur-0.14.4/tests/test_jp2kr.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/tests/test_jp2kr.py 2026-02-04 00:44:23.000000000 +0100 @@ -973,10 +973,7 @@ glymur.set_option('parse.full_codestream', False) def test_main_header(self): - """verify that the main header isn't loaded during normal parsing""" - # The hidden _main_header attribute should show up after accessing it. + """verify that the main header is loaded during normal parsing""" jp2 = Jp2kr(self.jp2file) jp2c = jp2.box[-1] - self.assertIsNone(jp2c._codestream) - jp2c.codestream - self.assertIsNotNone(jp2c._codestream) + self.assertIsNotNone(jp2c.codestream) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/tests/test_jpeg2jp2.py new/glymur-0.14.7/tests/test_jpeg2jp2.py --- old/glymur-0.14.4/tests/test_jpeg2jp2.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/tests/test_jpeg2jp2.py 2026-02-04 00:44:23.000000000 +0100 @@ -17,15 +17,10 @@ from .fixtures import ( OPENJPEG_NOT_AVAILABLE, OPENJPEG_NOT_AVAILABLE_MSG, - CANNOT_USE_IMPORTLIB_METADATA ) @unittest.skipIf(OPENJPEG_NOT_AVAILABLE, OPENJPEG_NOT_AVAILABLE_MSG) [email protected]( - CANNOT_USE_IMPORTLIB_METADATA, - 'missing importlib.metadata.files ?' -) class TestSuite(fixtures.TestJPEGCommon): def test_smoke(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glymur-0.14.4/tests/test_printing.py new/glymur-0.14.7/tests/test_printing.py --- old/glymur-0.14.4/tests/test_printing.py 2025-10-08 15:49:00.000000000 +0200 +++ new/glymur-0.14.7/tests/test_printing.py 2026-02-04 00:44:23.000000000 +0100 @@ -1580,8 +1580,8 @@ """ Verify printing with the full blown codestream """ - jp2 = Jp2k(self.jp2file) glymur.set_option('parse.full_codestream', True) + jp2 = Jp2k(self.jp2file) # Get rid of the file line actual = '\n'.join(str(jp2).splitlines()[1:])
