Glymur 0.14.5__tar.gz → 0.14.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {glymur-0.14.5 → glymur-0.14.7}/.circleci/config.yml +4 -0
- {glymur-0.14.5 → glymur-0.14.7}/CHANGES.txt +6 -2
- {glymur-0.14.5 → glymur-0.14.7}/Glymur.egg-info/PKG-INFO +1 -1
- {glymur-0.14.5 → glymur-0.14.7}/Glymur.egg-info/SOURCES.txt +1 -0
- {glymur-0.14.5 → glymur-0.14.7}/PKG-INFO +1 -1
- glymur-0.14.7/ci/ci-311-np1.yaml +13 -0
- {glymur-0.14.5 → glymur-0.14.7}/ci/ci-312.yaml +1 -1
- {glymur-0.14.5 → glymur-0.14.7}/ci/ci-313.yaml +1 -1
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/conf.py +2 -2
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.14.rst +16 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/jp2box.py +5 -23
- {glymur-0.14.5 → glymur-0.14.7}/glymur/jp2k.py +3 -2
- {glymur-0.14.5 → glymur-0.14.7}/glymur/jp2kr.py +48 -51
- {glymur-0.14.5 → glymur-0.14.7}/glymur/version.py +1 -1
- {glymur-0.14.5 → glymur-0.14.7}/pyproject.toml +1 -1
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2k.py +2 -5
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2kr.py +2 -5
- {glymur-0.14.5 → glymur-0.14.7}/.gitignore +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/.readthedocs.yaml +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/.travis.yml +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/Glymur.egg-info/dependency_links.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/Glymur.egg-info/entry_points.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/Glymur.egg-info/requires.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/Glymur.egg-info/top_level.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/LICENSE.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/MANIFEST.in +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/README.md +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/appveyor.yml +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/ci/ci-311.yaml +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/ci/ci-314-no-gdal.yaml +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/ci/ci-314-no-opj.yaml +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/ci/ci-314.yaml +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/ci/doc.yml +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/ci/install.ps1 +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/ci/run_script.sh +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/ci/run_with_env.cmd +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/ci/setup_env.sh +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/conftest.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/Makefile +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/make.bat +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/requirements.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/api.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/detailed_installation.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/goodstuff_alpha.png +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/how_do_i.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/index.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/introduction.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/roadmap.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.10.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.11.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.12.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.13.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.5.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.6.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.7.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.8.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.9.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/index.rst +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/__init__.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/_core_converter.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/_iccprofile.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/codestream.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/command_line.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/config.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/core.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/data/__init__.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/data/goodstuff.j2k +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/data/heliov.jpx +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/data/nemo.jp2 +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/jpeg.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/lib/__init__.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/lib/_tiff.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/lib/openjp2.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/lib/tiff.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/options.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/glymur/tiff.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/setup.cfg +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/__init__.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/__init__.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/__init__.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/file1_xml.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/file1_xml_box.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/p0_02.j2k +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/p0_03.j2k +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/p0_06.j2k +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/p1_06.j2k +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/p1_07.j2k +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/p1_07.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/__init__.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/edf_c2_1178956.jp2 +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/issue142.j2k +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/issue392.jp2 +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/issue396.jp2 +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/issue438.jp2 +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/issue626.j2k +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/jph_siz.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/oj-ht-byte.jph +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/text_GBR.jp2 +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/text_GBR_rreq.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/geo/0220000800_uuid.dat +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/geo/__init__.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/geo/gml.xml +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/appended_xml_box.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/countries.xml +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/decompression_parameters_type.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/default_compression_parameters_type.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/default_progression_order_changes_type.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/encoding_declaration.xml +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/goodstuff_codestream_header.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/goodstuff_with_full_header.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/issue186_progression_order.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/issue398.dat +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/issue405.dat +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/issue549.dat +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/issue555.xmp +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/issue982.j2k +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/multiple_precinct_size.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo_dump_no_codestream.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo_dump_no_codestream_no_xml.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo_dump_no_xml.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo_dump_short.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo_with_codestream_header.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo_xmp_box.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/no_jp2c.jp2 +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/sgray.icc +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/simple_rdf.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/simple_rdf.uuid-box.txt +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/uint16.j2k +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/__init__.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/astronaut8.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/astronaut8_stripped.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/astronaut_s_uint16.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/astronaut_uint16.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/astronaut_ycbcr_jpeg_tiled.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/goodstuff_32s.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/moon.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/moon3_partial_last_strip.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/moon3_stripped.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/moon63.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/moon_2x2.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/moon_3x3.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/stripped.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/ycbcr_bg.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/ycbcr_stripped.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/__init__.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/albers27-8.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/albers27.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/basn6a08.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/cmyk.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/degenerate_geotiff.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/flower-separated-planar-08.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/ieeefp32.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/issue572.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/issue678.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/uint32.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/warning.tif +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/fixtures.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_callbacks.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_cinema.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_codestream.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_colour_specification_box.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_commandline_jp2dump.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_commandline_jpeg2jp2.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_commandline_tiff2jp2.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_config.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_geo.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2box.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2box_jpx.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2box_uuid.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2box_xml.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2k_writes.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_jpeg2jp2.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_libtiff.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_openjp2.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_printing.py +1 -1
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_set_decoded_components.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_slicing.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_threading.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_tiff2jp2.py +0 -0
- {glymur-0.14.5 → glymur-0.14.7}/tests/test_warnings.py +0 -0
|
@@ -6,6 +6,7 @@ workflows:
|
|
|
6
6
|
version: 2
|
|
7
7
|
test:
|
|
8
8
|
jobs:
|
|
9
|
+
- ci-311-np1
|
|
9
10
|
- ci-311
|
|
10
11
|
- ci-312
|
|
11
12
|
- ci-313
|
|
@@ -47,6 +48,9 @@ test-template: &test-template
|
|
|
47
48
|
pytest --doctest-modules glymur
|
|
48
49
|
|
|
49
50
|
jobs:
|
|
51
|
+
ci-311-np1:
|
|
52
|
+
<<: *test-template
|
|
53
|
+
|
|
50
54
|
ci-311:
|
|
51
55
|
<<: *test-template
|
|
52
56
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Feb 04, 2026 - v0.14.7
|
|
2
|
+
Refactor image dimension validation
|
|
3
|
+
Refactor codestream parsing
|
|
4
|
+
|
|
5
|
+
Jan 26, 2026 - v0.14.6
|
|
6
|
+
Fix numpy 2.5 deprecation issue
|
|
3
7
|
|
|
4
8
|
Oct 08, 2025 - v0.14.4
|
|
5
9
|
Qualify on python 3.14
|
|
@@ -72,7 +72,7 @@ master_doc = 'index'
|
|
|
72
72
|
|
|
73
73
|
# General information about the project.
|
|
74
74
|
project = 'glymur'
|
|
75
|
-
copyright = '2013-
|
|
75
|
+
copyright = '2013-2026, John Evans'
|
|
76
76
|
|
|
77
77
|
# The version info for the project you're documenting, acts as replacement for
|
|
78
78
|
# |version| and |release|, also used in various other places throughout the
|
|
@@ -81,7 +81,7 @@ copyright = '2013-2025, John Evans'
|
|
|
81
81
|
# The short X.Y version.
|
|
82
82
|
version = '0.14'
|
|
83
83
|
# The full version, including alpha/beta/rc tags.
|
|
84
|
-
release = '0.14.
|
|
84
|
+
release = '0.14.7'
|
|
85
85
|
|
|
86
86
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
87
87
|
# for a list of supported languages.
|
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
Changes in glymur 0.14
|
|
3
3
|
######################
|
|
4
4
|
|
|
5
|
+
*****************
|
|
6
|
+
Changes in 0.14.7
|
|
7
|
+
*****************
|
|
8
|
+
|
|
9
|
+
* Refactor image dimension validation
|
|
10
|
+
* Refactor codestream parsing
|
|
11
|
+
* Update CI numpy specs
|
|
12
|
+
* Add CI workflow for numpy<2.0
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
*****************
|
|
16
|
+
Changes in 0.14.6
|
|
17
|
+
*****************
|
|
18
|
+
|
|
19
|
+
* Fix numpy 2.5 deprecation warning
|
|
20
|
+
|
|
5
21
|
*****************
|
|
6
22
|
Changes in 0.14.5
|
|
7
23
|
*****************
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
References
|
|
4
4
|
----------
|
|
5
|
-
.. [JP2K15444-1i] International Organization for
|
|
5
|
+
.. [JP2K15444-1i] International Organization for Standardization. ISO/IEC
|
|
6
6
|
15444-1:2004 - Information technology -- JPEG 2000 image coding system:
|
|
7
7
|
Core coding system
|
|
8
8
|
|
|
9
|
-
.. [JP2K15444-2m] International Organization for
|
|
9
|
+
.. [JP2K15444-2m] International Organization for Standardization. ISO/IEC
|
|
10
10
|
15444-2:2004 - Information technology -- JPEG 2000 image coding system:
|
|
11
11
|
Extensions
|
|
12
12
|
"""
|
|
@@ -1065,7 +1065,7 @@ class ContiguousCodestreamBox(Jp2kBox):
|
|
|
1065
1065
|
offset=-1
|
|
1066
1066
|
):
|
|
1067
1067
|
super().__init__()
|
|
1068
|
-
self.
|
|
1068
|
+
self.codestream = codestream
|
|
1069
1069
|
self.length = length
|
|
1070
1070
|
self.offset = offset
|
|
1071
1071
|
self.main_header_offset = main_header_offset
|
|
@@ -1073,24 +1073,6 @@ class ContiguousCodestreamBox(Jp2kBox):
|
|
|
1073
1073
|
# The filename can be set if lazy loading is desired.
|
|
1074
1074
|
self._filename = None
|
|
1075
1075
|
|
|
1076
|
-
@property
|
|
1077
|
-
def codestream(self):
|
|
1078
|
-
if get_option("parse.full_codestream") is True:
|
|
1079
|
-
header_only = False
|
|
1080
|
-
else:
|
|
1081
|
-
header_only = True
|
|
1082
|
-
if self._codestream is None:
|
|
1083
|
-
if self._filename is not None:
|
|
1084
|
-
with open(self._filename, "rb") as fptr:
|
|
1085
|
-
fptr.seek(self.main_header_offset)
|
|
1086
|
-
self._codestream = Codestream(
|
|
1087
|
-
fptr,
|
|
1088
|
-
self.length,
|
|
1089
|
-
header_only=header_only
|
|
1090
|
-
)
|
|
1091
|
-
|
|
1092
|
-
return self._codestream
|
|
1093
|
-
|
|
1094
1076
|
def __repr__(self):
|
|
1095
1077
|
msg = "glymur.jp2box.ContiguousCodeStreamBox"
|
|
1096
1078
|
msg += f"(codestream={repr(self.codestream)})"
|
|
@@ -1134,7 +1116,7 @@ class ContiguousCodestreamBox(Jp2kBox):
|
|
|
1134
1116
|
if get_option("parse.full_codestream"):
|
|
1135
1117
|
codestream = Codestream(fptr, length, header_only=False)
|
|
1136
1118
|
else:
|
|
1137
|
-
codestream =
|
|
1119
|
+
codestream = Codestream(fptr, length, header_only=True)
|
|
1138
1120
|
box = cls(
|
|
1139
1121
|
codestream,
|
|
1140
1122
|
main_header_offset=main_header_offset,
|
|
@@ -3555,7 +3537,7 @@ class UUIDBox(Jp2kBox):
|
|
|
3555
3537
|
|
|
3556
3538
|
References
|
|
3557
3539
|
----------
|
|
3558
|
-
.. [XMP] International Organization for
|
|
3540
|
+
.. [XMP] International Organization for Standardization. ISO/IEC
|
|
3559
3541
|
16684-1:2012 - Graphic technology -- Extensible metadata platform (XMP)
|
|
3560
3542
|
specification -- Part 1: Data model, serialization and core properties
|
|
3561
3543
|
"""
|
|
@@ -1079,8 +1079,9 @@ class Jp2k(Jp2kr):
|
|
|
1079
1079
|
else:
|
|
1080
1080
|
numrows, numcols, num_comps = self.shape
|
|
1081
1081
|
|
|
1082
|
-
|
|
1083
|
-
|
|
1082
|
+
if 0 in imgdata.shape:
|
|
1083
|
+
msg = f"The image has invalid dimensions, {imgdata.shape}."
|
|
1084
|
+
raise InvalidJp2kError(msg)
|
|
1084
1085
|
|
|
1085
1086
|
# set image offset and reference grid
|
|
1086
1087
|
image.contents.x0 = self._cparams.image_offset_x0
|
|
@@ -455,6 +455,13 @@ class Jp2kr(Jp2kBox):
|
|
|
455
455
|
# boxes) here.
|
|
456
456
|
fptr.seek(0)
|
|
457
457
|
self.box = self.parse_superbox(fptr)
|
|
458
|
+
|
|
459
|
+
# Set the codestream property if it is there. Do this now because
|
|
460
|
+
# the validation process would otherwise cause another file-open to
|
|
461
|
+
# occur and re-parse the codestream (if it exists).
|
|
462
|
+
jp2c = next(filter(lambda x: x.box_id == 'jp2c', self.box), None)
|
|
463
|
+
self._codestream = jp2c.codestream if jp2c is not None else None
|
|
464
|
+
|
|
458
465
|
self._validate()
|
|
459
466
|
|
|
460
467
|
self._parse_count += 1
|
|
@@ -926,7 +933,14 @@ class Jp2kr(Jp2kBox):
|
|
|
926
933
|
for k in range(raw_image.contents.numcomps):
|
|
927
934
|
component = raw_image.contents.comps[k]
|
|
928
935
|
|
|
929
|
-
|
|
936
|
+
# validate the image size
|
|
937
|
+
if nrows[k] == 0 or ncols[k] == 0:
|
|
938
|
+
# Letting this situation continue would segfault openjpeg.
|
|
939
|
+
msg = (
|
|
940
|
+
f"Component {k} has invalid dimensions, "
|
|
941
|
+
f"{nrows[k]} x {ncols[k]}"
|
|
942
|
+
)
|
|
943
|
+
raise InvalidJp2kError(msg)
|
|
930
944
|
|
|
931
945
|
addr = ctypes.addressof(component.data.contents)
|
|
932
946
|
with warnings.catch_warnings():
|
|
@@ -947,7 +961,7 @@ class Jp2kr(Jp2kBox):
|
|
|
947
961
|
if is_cube and image.shape[2] == 1:
|
|
948
962
|
# The third dimension has just a single layer. Make the image
|
|
949
963
|
# data 2D instead of 3D.
|
|
950
|
-
image
|
|
964
|
+
image = np.reshape(image, image.shape[0:2])
|
|
951
965
|
|
|
952
966
|
return image
|
|
953
967
|
|
|
@@ -984,10 +998,6 @@ class Jp2kr(Jp2kBox):
|
|
|
984
998
|
def get_codestream(self, header_only=True):
|
|
985
999
|
"""Retrieve codestream.
|
|
986
1000
|
|
|
987
|
-
This differs from the codestream property in that segment
|
|
988
|
-
metadata that lies past the end of the codestream header
|
|
989
|
-
can be retrieved.
|
|
990
|
-
|
|
991
1001
|
Parameters
|
|
992
1002
|
----------
|
|
993
1003
|
header_only : bool, optional
|
|
@@ -1023,50 +1033,37 @@ class Jp2kr(Jp2kBox):
|
|
|
1023
1033
|
|
|
1024
1034
|
# if it's just a raw codestream file, it's easy
|
|
1025
1035
|
if self._codec_format == opj2.CODEC_J2K:
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
# continue assuming JP2, must seek to the JP2C box and past its
|
|
1029
|
-
# header
|
|
1030
|
-
box = next(filter(lambda x: x.box_id == "jp2c", self.box), None)
|
|
1031
|
-
|
|
1032
|
-
fptr.seek(box.offset)
|
|
1033
|
-
read_buffer = fptr.read(8)
|
|
1034
|
-
(box_length, _) = struct.unpack(">I4s", read_buffer)
|
|
1035
|
-
if box_length == 0:
|
|
1036
|
-
# The length of the box is presumed to last until the end
|
|
1037
|
-
# of the file. Compute the effective length of the box.
|
|
1038
|
-
box_length = self.path.stat().st_size - fptr.tell() + 8
|
|
1039
|
-
elif box_length == 1:
|
|
1040
|
-
# Seek past the XL field.
|
|
1041
|
-
read_buffer = fptr.read(8)
|
|
1042
|
-
(box_length,) = struct.unpack(">Q", read_buffer)
|
|
1043
|
-
|
|
1044
|
-
return self._get_codestream(fptr, box_length - 8, header_only)
|
|
1045
|
-
|
|
1046
|
-
def _get_codestream(self, fptr, length, header_only):
|
|
1047
|
-
"""
|
|
1048
|
-
Parsing errors can make for confusing errors sometimes, so catch any
|
|
1049
|
-
such error and add context to it.
|
|
1050
|
-
"""
|
|
1036
|
+
length = self.length
|
|
1037
|
+
else:
|
|
1051
1038
|
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
f'because the codestream could not be parsed: "{value}"'
|
|
1059
|
-
)
|
|
1060
|
-
raise InvalidJp2kError(msg).with_traceback(traceback)
|
|
1061
|
-
else:
|
|
1062
|
-
return codestream
|
|
1039
|
+
# continue assuming JP2, must seek to the JP2C box and past its
|
|
1040
|
+
# header
|
|
1041
|
+
box = next(
|
|
1042
|
+
filter(lambda x: x.box_id == "jp2c", self.box),
|
|
1043
|
+
None
|
|
1044
|
+
)
|
|
1063
1045
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1046
|
+
fptr.seek(box.offset)
|
|
1047
|
+
read_buffer = fptr.read(8)
|
|
1048
|
+
(box_length, _) = struct.unpack(">I4s", read_buffer)
|
|
1049
|
+
if box_length == 0:
|
|
1050
|
+
# The length of the box is presumed to last until the end
|
|
1051
|
+
# of the file. Compute the effective length of the box.
|
|
1052
|
+
box_length = self.path.stat().st_size - fptr.tell() + 8
|
|
1053
|
+
elif box_length == 1:
|
|
1054
|
+
# Seek past the XL field.
|
|
1055
|
+
read_buffer = fptr.read(8)
|
|
1056
|
+
(box_length,) = struct.unpack(">Q", read_buffer)
|
|
1057
|
+
length = box_length - 8
|
|
1058
|
+
|
|
1059
|
+
try:
|
|
1060
|
+
codestream = Codestream(fptr, length, header_only=header_only)
|
|
1061
|
+
except Exception:
|
|
1062
|
+
_, value, traceback = sys.exc_info()
|
|
1063
|
+
msg = (
|
|
1064
|
+
f"The file is invalid "
|
|
1065
|
+
f'because the codestream could not be parsed: "{value}"'
|
|
1066
|
+
)
|
|
1067
|
+
raise InvalidJp2kError(msg).with_traceback(traceback)
|
|
1068
|
+
else:
|
|
1069
|
+
return codestream
|
|
@@ -1056,10 +1056,7 @@ class TestParsing(unittest.TestCase):
|
|
|
1056
1056
|
glymur.set_option("parse.full_codestream", False)
|
|
1057
1057
|
|
|
1058
1058
|
def test_main_header(self):
|
|
1059
|
-
"""verify that the main header
|
|
1060
|
-
# The hidden _main_header attribute should show up after accessing it.
|
|
1059
|
+
"""verify that the main header is loaded during normal parsing"""
|
|
1061
1060
|
jp2 = Jp2k(self.jp2file)
|
|
1062
1061
|
jp2c = jp2.box[3]
|
|
1063
|
-
self.
|
|
1064
|
-
jp2c.codestream
|
|
1065
|
-
self.assertIsNotNone(jp2c._codestream)
|
|
1062
|
+
self.assertIsNotNone(jp2c.codestream)
|
|
@@ -973,10 +973,7 @@ class TestParsing(unittest.TestCase):
|
|
|
973
973
|
glymur.set_option('parse.full_codestream', False)
|
|
974
974
|
|
|
975
975
|
def test_main_header(self):
|
|
976
|
-
"""verify that the main header
|
|
977
|
-
# The hidden _main_header attribute should show up after accessing it.
|
|
976
|
+
"""verify that the main header is loaded during normal parsing"""
|
|
978
977
|
jp2 = Jp2kr(self.jp2file)
|
|
979
978
|
jp2c = jp2.box[-1]
|
|
980
|
-
self.
|
|
981
|
-
jp2c.codestream
|
|
982
|
-
self.assertIsNotNone(jp2c._codestream)
|
|
979
|
+
self.assertIsNotNone(jp2c.codestream)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1580,8 +1580,8 @@ class TestPrinting(fixtures.TestCommon):
|
|
|
1580
1580
|
"""
|
|
1581
1581
|
Verify printing with the full blown codestream
|
|
1582
1582
|
"""
|
|
1583
|
-
jp2 = Jp2k(self.jp2file)
|
|
1584
1583
|
glymur.set_option('parse.full_codestream', True)
|
|
1584
|
+
jp2 = Jp2k(self.jp2file)
|
|
1585
1585
|
|
|
1586
1586
|
# Get rid of the file line
|
|
1587
1587
|
actual = '\n'.join(str(jp2).splitlines()[1:])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|