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.
Files changed (181) hide show
  1. {glymur-0.14.5 → glymur-0.14.7}/.circleci/config.yml +4 -0
  2. {glymur-0.14.5 → glymur-0.14.7}/CHANGES.txt +6 -2
  3. {glymur-0.14.5 → glymur-0.14.7}/Glymur.egg-info/PKG-INFO +1 -1
  4. {glymur-0.14.5 → glymur-0.14.7}/Glymur.egg-info/SOURCES.txt +1 -0
  5. {glymur-0.14.5 → glymur-0.14.7}/PKG-INFO +1 -1
  6. glymur-0.14.7/ci/ci-311-np1.yaml +13 -0
  7. {glymur-0.14.5 → glymur-0.14.7}/ci/ci-312.yaml +1 -1
  8. {glymur-0.14.5 → glymur-0.14.7}/ci/ci-313.yaml +1 -1
  9. {glymur-0.14.5 → glymur-0.14.7}/docs/source/conf.py +2 -2
  10. {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.14.rst +16 -0
  11. {glymur-0.14.5 → glymur-0.14.7}/glymur/jp2box.py +5 -23
  12. {glymur-0.14.5 → glymur-0.14.7}/glymur/jp2k.py +3 -2
  13. {glymur-0.14.5 → glymur-0.14.7}/glymur/jp2kr.py +48 -51
  14. {glymur-0.14.5 → glymur-0.14.7}/glymur/version.py +1 -1
  15. {glymur-0.14.5 → glymur-0.14.7}/pyproject.toml +1 -1
  16. {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2k.py +2 -5
  17. {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2kr.py +2 -5
  18. {glymur-0.14.5 → glymur-0.14.7}/.gitignore +0 -0
  19. {glymur-0.14.5 → glymur-0.14.7}/.readthedocs.yaml +0 -0
  20. {glymur-0.14.5 → glymur-0.14.7}/.travis.yml +0 -0
  21. {glymur-0.14.5 → glymur-0.14.7}/Glymur.egg-info/dependency_links.txt +0 -0
  22. {glymur-0.14.5 → glymur-0.14.7}/Glymur.egg-info/entry_points.txt +0 -0
  23. {glymur-0.14.5 → glymur-0.14.7}/Glymur.egg-info/requires.txt +0 -0
  24. {glymur-0.14.5 → glymur-0.14.7}/Glymur.egg-info/top_level.txt +0 -0
  25. {glymur-0.14.5 → glymur-0.14.7}/LICENSE.txt +0 -0
  26. {glymur-0.14.5 → glymur-0.14.7}/MANIFEST.in +0 -0
  27. {glymur-0.14.5 → glymur-0.14.7}/README.md +0 -0
  28. {glymur-0.14.5 → glymur-0.14.7}/appveyor.yml +0 -0
  29. {glymur-0.14.5 → glymur-0.14.7}/ci/ci-311.yaml +0 -0
  30. {glymur-0.14.5 → glymur-0.14.7}/ci/ci-314-no-gdal.yaml +0 -0
  31. {glymur-0.14.5 → glymur-0.14.7}/ci/ci-314-no-opj.yaml +0 -0
  32. {glymur-0.14.5 → glymur-0.14.7}/ci/ci-314.yaml +0 -0
  33. {glymur-0.14.5 → glymur-0.14.7}/ci/doc.yml +0 -0
  34. {glymur-0.14.5 → glymur-0.14.7}/ci/install.ps1 +0 -0
  35. {glymur-0.14.5 → glymur-0.14.7}/ci/run_script.sh +0 -0
  36. {glymur-0.14.5 → glymur-0.14.7}/ci/run_with_env.cmd +0 -0
  37. {glymur-0.14.5 → glymur-0.14.7}/ci/setup_env.sh +0 -0
  38. {glymur-0.14.5 → glymur-0.14.7}/conftest.py +0 -0
  39. {glymur-0.14.5 → glymur-0.14.7}/docs/Makefile +0 -0
  40. {glymur-0.14.5 → glymur-0.14.7}/docs/make.bat +0 -0
  41. {glymur-0.14.5 → glymur-0.14.7}/docs/requirements.txt +0 -0
  42. {glymur-0.14.5 → glymur-0.14.7}/docs/source/api.rst +0 -0
  43. {glymur-0.14.5 → glymur-0.14.7}/docs/source/detailed_installation.rst +0 -0
  44. {glymur-0.14.5 → glymur-0.14.7}/docs/source/goodstuff_alpha.png +0 -0
  45. {glymur-0.14.5 → glymur-0.14.7}/docs/source/how_do_i.rst +0 -0
  46. {glymur-0.14.5 → glymur-0.14.7}/docs/source/index.rst +0 -0
  47. {glymur-0.14.5 → glymur-0.14.7}/docs/source/introduction.rst +0 -0
  48. {glymur-0.14.5 → glymur-0.14.7}/docs/source/roadmap.rst +0 -0
  49. {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.10.rst +0 -0
  50. {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.11.rst +0 -0
  51. {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.12.rst +0 -0
  52. {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.13.rst +0 -0
  53. {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.5.rst +0 -0
  54. {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.6.rst +0 -0
  55. {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.7.rst +0 -0
  56. {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.8.rst +0 -0
  57. {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/0.9.rst +0 -0
  58. {glymur-0.14.5 → glymur-0.14.7}/docs/source/whatsnew/index.rst +0 -0
  59. {glymur-0.14.5 → glymur-0.14.7}/glymur/__init__.py +0 -0
  60. {glymur-0.14.5 → glymur-0.14.7}/glymur/_core_converter.py +0 -0
  61. {glymur-0.14.5 → glymur-0.14.7}/glymur/_iccprofile.py +0 -0
  62. {glymur-0.14.5 → glymur-0.14.7}/glymur/codestream.py +0 -0
  63. {glymur-0.14.5 → glymur-0.14.7}/glymur/command_line.py +0 -0
  64. {glymur-0.14.5 → glymur-0.14.7}/glymur/config.py +0 -0
  65. {glymur-0.14.5 → glymur-0.14.7}/glymur/core.py +0 -0
  66. {glymur-0.14.5 → glymur-0.14.7}/glymur/data/__init__.py +0 -0
  67. {glymur-0.14.5 → glymur-0.14.7}/glymur/data/goodstuff.j2k +0 -0
  68. {glymur-0.14.5 → glymur-0.14.7}/glymur/data/heliov.jpx +0 -0
  69. {glymur-0.14.5 → glymur-0.14.7}/glymur/data/nemo.jp2 +0 -0
  70. {glymur-0.14.5 → glymur-0.14.7}/glymur/jpeg.py +0 -0
  71. {glymur-0.14.5 → glymur-0.14.7}/glymur/lib/__init__.py +0 -0
  72. {glymur-0.14.5 → glymur-0.14.7}/glymur/lib/_tiff.py +0 -0
  73. {glymur-0.14.5 → glymur-0.14.7}/glymur/lib/openjp2.py +0 -0
  74. {glymur-0.14.5 → glymur-0.14.7}/glymur/lib/tiff.py +0 -0
  75. {glymur-0.14.5 → glymur-0.14.7}/glymur/options.py +0 -0
  76. {glymur-0.14.5 → glymur-0.14.7}/glymur/tiff.py +0 -0
  77. {glymur-0.14.5 → glymur-0.14.7}/setup.cfg +0 -0
  78. {glymur-0.14.5 → glymur-0.14.7}/tests/__init__.py +0 -0
  79. {glymur-0.14.5 → glymur-0.14.7}/tests/data/__init__.py +0 -0
  80. {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/__init__.py +0 -0
  81. {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/file1_xml.txt +0 -0
  82. {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/file1_xml_box.txt +0 -0
  83. {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/p0_02.j2k +0 -0
  84. {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/p0_03.j2k +0 -0
  85. {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/p0_06.j2k +0 -0
  86. {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/p1_06.j2k +0 -0
  87. {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/p1_07.j2k +0 -0
  88. {glymur-0.14.5 → glymur-0.14.7}/tests/data/conformance/p1_07.txt +0 -0
  89. {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/__init__.py +0 -0
  90. {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/edf_c2_1178956.jp2 +0 -0
  91. {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/issue142.j2k +0 -0
  92. {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/issue392.jp2 +0 -0
  93. {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/issue396.jp2 +0 -0
  94. {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/issue438.jp2 +0 -0
  95. {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/issue626.j2k +0 -0
  96. {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/jph_siz.txt +0 -0
  97. {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/oj-ht-byte.jph +0 -0
  98. {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/text_GBR.jp2 +0 -0
  99. {glymur-0.14.5 → glymur-0.14.7}/tests/data/from-openjpeg/text_GBR_rreq.txt +0 -0
  100. {glymur-0.14.5 → glymur-0.14.7}/tests/data/geo/0220000800_uuid.dat +0 -0
  101. {glymur-0.14.5 → glymur-0.14.7}/tests/data/geo/__init__.py +0 -0
  102. {glymur-0.14.5 → glymur-0.14.7}/tests/data/geo/gml.xml +0 -0
  103. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/appended_xml_box.txt +0 -0
  104. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/countries.xml +0 -0
  105. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/decompression_parameters_type.txt +0 -0
  106. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/default_compression_parameters_type.txt +0 -0
  107. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/default_progression_order_changes_type.txt +0 -0
  108. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/encoding_declaration.xml +0 -0
  109. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/goodstuff_codestream_header.txt +0 -0
  110. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/goodstuff_with_full_header.txt +0 -0
  111. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/issue186_progression_order.txt +0 -0
  112. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/issue398.dat +0 -0
  113. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/issue405.dat +0 -0
  114. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/issue549.dat +0 -0
  115. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/issue555.xmp +0 -0
  116. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/issue982.j2k +0 -0
  117. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/multiple_precinct_size.txt +0 -0
  118. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo.txt +0 -0
  119. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo_dump_no_codestream.txt +0 -0
  120. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo_dump_no_codestream_no_xml.txt +0 -0
  121. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo_dump_no_xml.txt +0 -0
  122. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo_dump_short.txt +0 -0
  123. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo_with_codestream_header.txt +0 -0
  124. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/nemo_xmp_box.txt +0 -0
  125. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/no_jp2c.jp2 +0 -0
  126. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/sgray.icc +0 -0
  127. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/simple_rdf.txt +0 -0
  128. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/simple_rdf.uuid-box.txt +0 -0
  129. {glymur-0.14.5 → glymur-0.14.7}/tests/data/misc/uint16.j2k +0 -0
  130. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/__init__.py +0 -0
  131. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/astronaut8.tif +0 -0
  132. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/astronaut8_stripped.tif +0 -0
  133. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/astronaut_s_uint16.tif +0 -0
  134. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/astronaut_uint16.tif +0 -0
  135. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/astronaut_ycbcr_jpeg_tiled.tif +0 -0
  136. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/goodstuff_32s.tif +0 -0
  137. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/moon.tif +0 -0
  138. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/moon3_partial_last_strip.tif +0 -0
  139. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/moon3_stripped.tif +0 -0
  140. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/moon63.tif +0 -0
  141. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/moon_2x2.tif +0 -0
  142. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/moon_3x3.tif +0 -0
  143. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/stripped.tif +0 -0
  144. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/ycbcr_bg.tif +0 -0
  145. {glymur-0.14.5 → glymur-0.14.7}/tests/data/skimage/ycbcr_stripped.tif +0 -0
  146. {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/__init__.py +0 -0
  147. {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/albers27-8.tif +0 -0
  148. {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/albers27.tif +0 -0
  149. {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/basn6a08.tif +0 -0
  150. {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/cmyk.tif +0 -0
  151. {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/degenerate_geotiff.tif +0 -0
  152. {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/flower-separated-planar-08.tif +0 -0
  153. {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/ieeefp32.tif +0 -0
  154. {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/issue572.tif +0 -0
  155. {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/issue678.tif +0 -0
  156. {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/uint32.tif +0 -0
  157. {glymur-0.14.5 → glymur-0.14.7}/tests/data/tiff/warning.tif +0 -0
  158. {glymur-0.14.5 → glymur-0.14.7}/tests/fixtures.py +0 -0
  159. {glymur-0.14.5 → glymur-0.14.7}/tests/test_callbacks.py +0 -0
  160. {glymur-0.14.5 → glymur-0.14.7}/tests/test_cinema.py +0 -0
  161. {glymur-0.14.5 → glymur-0.14.7}/tests/test_codestream.py +0 -0
  162. {glymur-0.14.5 → glymur-0.14.7}/tests/test_colour_specification_box.py +0 -0
  163. {glymur-0.14.5 → glymur-0.14.7}/tests/test_commandline_jp2dump.py +0 -0
  164. {glymur-0.14.5 → glymur-0.14.7}/tests/test_commandline_jpeg2jp2.py +0 -0
  165. {glymur-0.14.5 → glymur-0.14.7}/tests/test_commandline_tiff2jp2.py +0 -0
  166. {glymur-0.14.5 → glymur-0.14.7}/tests/test_config.py +0 -0
  167. {glymur-0.14.5 → glymur-0.14.7}/tests/test_geo.py +0 -0
  168. {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2box.py +0 -0
  169. {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2box_jpx.py +0 -0
  170. {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2box_uuid.py +0 -0
  171. {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2box_xml.py +0 -0
  172. {glymur-0.14.5 → glymur-0.14.7}/tests/test_jp2k_writes.py +0 -0
  173. {glymur-0.14.5 → glymur-0.14.7}/tests/test_jpeg2jp2.py +0 -0
  174. {glymur-0.14.5 → glymur-0.14.7}/tests/test_libtiff.py +0 -0
  175. {glymur-0.14.5 → glymur-0.14.7}/tests/test_openjp2.py +0 -0
  176. {glymur-0.14.5 → glymur-0.14.7}/tests/test_printing.py +1 -1
  177. {glymur-0.14.5 → glymur-0.14.7}/tests/test_set_decoded_components.py +0 -0
  178. {glymur-0.14.5 → glymur-0.14.7}/tests/test_slicing.py +0 -0
  179. {glymur-0.14.5 → glymur-0.14.7}/tests/test_threading.py +0 -0
  180. {glymur-0.14.5 → glymur-0.14.7}/tests/test_tiff2jp2.py +0 -0
  181. {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
- Jan 25, 2025 - v0.14.5
2
- Remove two debugging breakpoints
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Glymur
3
- Version: 0.14.5
3
+ Version: 0.14.7
4
4
  Summary: Read and write JPEG 2000 files
5
5
  Author-email: John Evans <jevans667cc@proton.me>
6
6
  License-Expression: MIT
@@ -15,6 +15,7 @@ Glymur.egg-info/dependency_links.txt
15
15
  Glymur.egg-info/entry_points.txt
16
16
  Glymur.egg-info/requires.txt
17
17
  Glymur.egg-info/top_level.txt
18
+ ci/ci-311-np1.yaml
18
19
  ci/ci-311.yaml
19
20
  ci/ci-312.yaml
20
21
  ci/ci-313.yaml
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Glymur
3
- Version: 0.14.5
3
+ Version: 0.14.7
4
4
  Summary: Read and write JPEG 2000 files
5
5
  Author-email: John Evans <jevans667cc@proton.me>
6
6
  License-Expression: MIT
@@ -0,0 +1,13 @@
1
+ name: glymur
2
+ channels:
3
+ - conda-forge
4
+ dependencies:
5
+ - python=3.11.*
6
+ - gdal>=3.8.0,<3.9.0
7
+ - pillow
8
+ - libtiff>=4.6.0,<4.7.0
9
+ - lxml>=5.0
10
+ - numpy<2.0
11
+ - openjpeg>=2.5
12
+ - pytest-xdist
13
+ - scikit-image
@@ -7,7 +7,7 @@ dependencies:
7
7
  - pillow
8
8
  - libtiff>=4.7.0,<4.8.0
9
9
  - lxml>=5.0.0
10
- - numpy>=2.0
10
+ - numpy>=2.0,<2.3
11
11
  - openjpeg>=2.5
12
12
  - pytest-xdist
13
13
  - scikit-image
@@ -8,7 +8,7 @@ dependencies:
8
8
  - pillow
9
9
  - libtiff>=4.7.0,<4.8.0
10
10
  - lxml>=5.3.0,<6.0.0
11
- - numpy>=2.1,<2.3.3
11
+ - numpy>=2.3,<2.4
12
12
  - openjpeg>=2.5.3,<2.5.4
13
13
  - pytest-xdist
14
14
  - scikit-image
@@ -72,7 +72,7 @@ master_doc = 'index'
72
72
 
73
73
  # General information about the project.
74
74
  project = 'glymur'
75
- copyright = '2013-2025, John Evans'
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.5'
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 Standardication. ISO/IEC
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 Standardication. ISO/IEC
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._codestream = codestream
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 = None
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 Standardication. ISO/IEC
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
- for k in range(num_comps):
1083
- self._validate_nonzero_image_size(numrows, numcols, k)
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
- self._validate_nonzero_image_size(nrows[k], ncols[k], k)
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.shape = image.shape[0:2]
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
- return self._get_codestream(fptr, self.length, header_only)
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
- try:
1053
- codestream = Codestream(fptr, length, header_only=header_only)
1054
- except Exception:
1055
- _, value, traceback = sys.exc_info()
1056
- msg = (
1057
- f"The file is invalid "
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
- def _validate_nonzero_image_size(self, nrows, ncols, component_index):
1065
- """The image cannot have area of zero."""
1066
- if nrows == 0 or ncols == 0:
1067
- # Letting this situation continue would segfault openjpeg.
1068
- msg = (
1069
- f"Component {component_index} has dimensions "
1070
- f"{nrows} x {ncols}"
1071
- )
1072
- raise InvalidJp2kError(msg)
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
@@ -20,7 +20,7 @@ from .lib import _tiff as tiff
20
20
 
21
21
  # Do not change the format of this next line! Doing so risks breaking
22
22
  # setup.py
23
- version = "0.14.5"
23
+ version = "0.14.7"
24
24
 
25
25
  version_tuple = parse(version).release
26
26
 
@@ -22,7 +22,7 @@ license = 'MIT'
22
22
  name = 'Glymur'
23
23
  readme = 'README.md'
24
24
  requires-python = '>=3.11'
25
- version = '0.14.5'
25
+ version = '0.14.7'
26
26
 
27
27
  [project.scripts]
28
28
  jp2dump = 'glymur.command_line:main'
@@ -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 isn't loaded during normal parsing"""
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.assertIsNone(jp2c._codestream)
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 isn't loaded during normal parsing"""
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.assertIsNone(jp2c._codestream)
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
@@ -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