Glymur 0.14.1__py3-none-any.whl → 0.14.2__py3-none-any.whl
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/jp2k.py +3 -3
- glymur/jp2kr.py +12 -22
- glymur/lib/_tiff.py +2142 -0
- glymur/lib/tiff.py +6 -2138
- glymur/tiff.py +2 -2
- glymur/version.py +1 -1
- {glymur-0.14.1.dist-info → glymur-0.14.2.dist-info}/METADATA +2 -2
- {glymur-0.14.1.dist-info → glymur-0.14.2.dist-info}/RECORD +12 -11
- {glymur-0.14.1.dist-info → glymur-0.14.2.dist-info}/WHEEL +1 -1
- {glymur-0.14.1.dist-info → glymur-0.14.2.dist-info}/entry_points.txt +0 -0
- {glymur-0.14.1.dist-info → glymur-0.14.2.dist-info}/licenses/LICENSE.txt +0 -0
- {glymur-0.14.1.dist-info → glymur-0.14.2.dist-info}/top_level.txt +0 -0
glymur/jp2k.py
CHANGED
|
@@ -216,7 +216,7 @@ class Jp2k(Jp2kr):
|
|
|
216
216
|
force : bool
|
|
217
217
|
If true, then run finalize operations
|
|
218
218
|
"""
|
|
219
|
-
self.
|
|
219
|
+
self._parse(force=force_parse)
|
|
220
220
|
|
|
221
221
|
if (
|
|
222
222
|
self._capture_resolution is None
|
|
@@ -256,7 +256,7 @@ class Jp2k(Jp2kr):
|
|
|
256
256
|
temp_filename = self.filename + ".tmp"
|
|
257
257
|
self.wrap(temp_filename, boxes=self.box)
|
|
258
258
|
shutil.move(temp_filename, self.filename)
|
|
259
|
-
self.
|
|
259
|
+
self._parse(force=True)
|
|
260
260
|
|
|
261
261
|
def _validate_kwargs(self):
|
|
262
262
|
"""Validate keyword parameters passed to the constructor."""
|
|
@@ -817,7 +817,7 @@ class Jp2k(Jp2kr):
|
|
|
817
817
|
with self.path.open("ab") as ofile:
|
|
818
818
|
box.write(ofile)
|
|
819
819
|
|
|
820
|
-
self.
|
|
820
|
+
self._parse(force=True)
|
|
821
821
|
|
|
822
822
|
def wrap(self, filename, boxes=None):
|
|
823
823
|
"""
|
glymur/jp2kr.py
CHANGED
|
@@ -107,7 +107,7 @@ class Jp2kr(Jp2kBox):
|
|
|
107
107
|
if not self.path.exists():
|
|
108
108
|
raise FileNotFoundError(f"{self.filename} does not exist.")
|
|
109
109
|
|
|
110
|
-
self.
|
|
110
|
+
self._parse()
|
|
111
111
|
self._initialize_shape()
|
|
112
112
|
|
|
113
113
|
def _initialize_shape(self):
|
|
@@ -393,6 +393,15 @@ class Jp2kr(Jp2kBox):
|
|
|
393
393
|
return "\n".join(metadata)
|
|
394
394
|
|
|
395
395
|
def parse(self, force=False):
|
|
396
|
+
"""
|
|
397
|
+
.. deprecated:: 0.15.0
|
|
398
|
+
"""
|
|
399
|
+
breakpoint()
|
|
400
|
+
msg = "Deprecated, do not use."
|
|
401
|
+
warnings.warn(msg, DeprecationWarning)
|
|
402
|
+
self._parse(force=force)
|
|
403
|
+
|
|
404
|
+
def _parse(self, force=False):
|
|
396
405
|
"""Parses the JPEG 2000 file.
|
|
397
406
|
|
|
398
407
|
Parameters
|
|
@@ -633,25 +642,6 @@ class Jp2kr(Jp2kBox):
|
|
|
633
642
|
# Ok, 3 arguments in pargs.
|
|
634
643
|
return data[:, :, bands]
|
|
635
644
|
|
|
636
|
-
def read(self, **kwargs):
|
|
637
|
-
"""Read a JPEG 2000 image.
|
|
638
|
-
|
|
639
|
-
.. deprecated:: 0.13.5
|
|
640
|
-
Use numpy-style slicing instead.
|
|
641
|
-
|
|
642
|
-
Returns
|
|
643
|
-
-------
|
|
644
|
-
img_array : ndarray
|
|
645
|
-
The image data.
|
|
646
|
-
"""
|
|
647
|
-
|
|
648
|
-
if "ignore_pclr_cmap_cdef" in kwargs:
|
|
649
|
-
self.ignore_pclr_cmap_cdef = kwargs["ignore_pclr_cmap_cdef"]
|
|
650
|
-
kwargs.pop("ignore_pclr_cmap_cdef")
|
|
651
|
-
warnings.warn("Use array-style slicing instead.", DeprecationWarning)
|
|
652
|
-
img = self._read(**kwargs)
|
|
653
|
-
return img
|
|
654
|
-
|
|
655
645
|
def _subsampling_sanity_check(self):
|
|
656
646
|
"""Check for differing subsample factors."""
|
|
657
647
|
if self._decoded_components is None:
|
|
@@ -854,7 +844,7 @@ class Jp2kr(Jp2kBox):
|
|
|
854
844
|
|
|
855
845
|
The only time you should ever use this method is when the image has
|
|
856
846
|
different subsampling factors across components. Otherwise you should
|
|
857
|
-
use
|
|
847
|
+
use numpy-style slicing.
|
|
858
848
|
|
|
859
849
|
Parameters
|
|
860
850
|
----------
|
|
@@ -966,7 +956,7 @@ class Jp2kr(Jp2kBox):
|
|
|
966
956
|
return image
|
|
967
957
|
|
|
968
958
|
def _component2dtype(self, component):
|
|
969
|
-
"""
|
|
959
|
+
"""Determine the appropriate numpy datatype for an OpenJPEG component.
|
|
970
960
|
|
|
971
961
|
Parameters
|
|
972
962
|
----------
|