Glymur 0.13.3__py3-none-any.whl → 0.13.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Glymur
3
- Version: 0.13.3
3
+ Version: 0.13.4
4
4
  Home-page: https://github.com/quintusdias/glymur
5
5
  Author: 'John Evans'
6
6
  Author-email: "John Evans" <jevans667cc@proton.me>
@@ -1,15 +1,15 @@
1
1
  glymur/__init__.py,sha256=k14IfdaYuTWXSpAIDR3LVDtXt9XKjr-ZSNXCyu8pQko,586
2
2
  glymur/_iccprofile.py,sha256=_WfQsT-BqEWQzQVTtuY7tSXqPjOtwvWGW36rKxlLv1s,4148
3
- glymur/codestream.py,sha256=qZbCCJGrsIy4Q9zzeITNN_bP90HtCHFOcbZdInDfAAY,60011
3
+ glymur/codestream.py,sha256=In4WjEhm9pjIOgrXOTzX-G2imF13K_o7aV8Dz4uOMhs,60295
4
4
  glymur/command_line.py,sha256=jm-6dD2jcU_G7mJAJ0U5sanfG9kRy-j0-G3eSN_Ieek,7476
5
5
  glymur/config.py,sha256=ceGulS8TN2OYiTPtq3mAdhXrCCRlxjuLmvN_UG0009Y,4139
6
6
  glymur/core.py,sha256=IDkk8FESyukQTB10LHBZ4VQM36NwKE4CXCcuJ407Kzg,3638
7
- glymur/jp2box.py,sha256=-fprGcnwgm4HC9D8jxWmvsMZbDdum6C1Zc4cCJWNIZM,112390
8
- glymur/jp2k.py,sha256=QS1bIi013b0AWRPvc90kwdVXMwblbJXU8MvP9zigy3g,54455
7
+ glymur/jp2box.py,sha256=qh1xUGKoGgVrUHq48yRcJAk7miJ__Udua8QHPTxpfQY,112434
8
+ glymur/jp2k.py,sha256=o2Pg0GgbLd4nto8woYFCmvVemrqMDKXWGgt64fZbjuQ,54520
9
9
  glymur/jp2kr.py,sha256=hUxFRXaJI9qmnZ7wNPr_4N-c-JEP7YiM_ea4FpmWD_w,32358
10
10
  glymur/options.py,sha256=Y777g4wpxPqRAF8s963goeAIogfLqIe_Dyd9f77MfmU,4428
11
11
  glymur/tiff.py,sha256=2uoKfyoyPQWAsdPWB0IxW_npqpP4O10qVADQZf10jXs,41115
12
- glymur/version.py,sha256=dGkLU9MNyK0Ikb9XIC4M4aoDNPJQDZ0zq1OTF7zgtiU,981
12
+ glymur/version.py,sha256=aSurVIzgqNAnAJrBLPJKDh99onXgPAcWVn99bnX4wus,981
13
13
  glymur/data/__init__.py,sha256=n2KZrHV15it7Wu4YCaBLXui1ZleQ30dnZ92dyP6q05k,955
14
14
  glymur/data/goodstuff.j2k,sha256=xKQG68KMu33gYjRUDTQvam1Cue2tdio85rNp5J-rYZE,115220
15
15
  glymur/data/heliov.jpx,sha256=KXnYdBZgl25jcGLu-m-QfhuP9pqUXV0Hp9HHEdJqr34,1399071
@@ -17,9 +17,9 @@ glymur/data/nemo.jp2,sha256=yJ1NkTEwU0B_gBtAiA1c5hxtGYSJtJgq6cHC2IHpj70,1132373
17
17
  glymur/lib/__init__.py,sha256=JnM9oPfcZhBDLKo7_yLS-lIRQ1wXb1N9hKKQ-G7vYVk,127
18
18
  glymur/lib/openjp2.py,sha256=VHCy_TnBSDqQ8YlIQHkyFqUXOQ2E5C3jxJoziG73s0I,45052
19
19
  glymur/lib/tiff.py,sha256=2o29IzYTsprVR_C6VDNHOzqk_U7aUdCoLQ2fjiyyoaI,50777
20
- Glymur-0.13.3.dist-info/LICENSE.txt,sha256=G9pvBgkJdPTtZqQmoRyIgAydtic1ZwWtOWBea9VMW7I,1077
21
- Glymur-0.13.3.dist-info/METADATA,sha256=dCBeH__9F8mkVEsr9w8_5KpWn92be25pGQY7IAlqGy0,1020
22
- Glymur-0.13.3.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
23
- Glymur-0.13.3.dist-info/entry_points.txt,sha256=inzxpDbDDfIxtdXpCncAHdAdwJfjtXt3xKvIOsuZsG8,93
24
- Glymur-0.13.3.dist-info/top_level.txt,sha256=D0SvtBUoPxOs40OTRW3l-kjGFHM6VrXS8yZPK5Fx2wY,7
25
- Glymur-0.13.3.dist-info/RECORD,,
20
+ Glymur-0.13.4.dist-info/LICENSE.txt,sha256=G9pvBgkJdPTtZqQmoRyIgAydtic1ZwWtOWBea9VMW7I,1077
21
+ Glymur-0.13.4.dist-info/METADATA,sha256=R0fok_sUg2bhWbDOWZowQ6jjzRJFBI5SNKhRCw_JkkI,1020
22
+ Glymur-0.13.4.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
23
+ Glymur-0.13.4.dist-info/entry_points.txt,sha256=inzxpDbDDfIxtdXpCncAHdAdwJfjtXt3xKvIOsuZsG8,93
24
+ Glymur-0.13.4.dist-info/top_level.txt,sha256=D0SvtBUoPxOs40OTRW3l-kjGFHM6VrXS8yZPK5Fx2wY,7
25
+ Glymur-0.13.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.1.1)
2
+ Generator: setuptools (70.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
glymur/codestream.py CHANGED
@@ -736,7 +736,9 @@ class Codestream(object):
736
736
  data = struct.unpack_from('>HIIIIIIIIH', read_buffer)
737
737
 
738
738
  rsiz = data[0]
739
- if rsiz not in _KNOWN_PROFILES:
739
+
740
+ # Bit 14 (16384) signifies HTJ2K (JPH)
741
+ if rsiz not in _KNOWN_PROFILES and not np.bitwise_and(rsiz, 16384):
740
742
  msg = f"Invalid profile: (Rsiz={rsiz})."
741
743
  warnings.warn(msg, UserWarning)
742
744
 
@@ -1666,7 +1668,12 @@ class SIZsegment(Segment):
1666
1668
  try:
1667
1669
  profile = _CAPABILITIES_DISPLAY[self.rsiz]
1668
1670
  except KeyError:
1669
- profile = f'{self.rsiz} (invalid)'
1671
+ if np.bitwise_and(self.rsiz, 16384):
1672
+ # HTJ2K profile that is uninterpreted
1673
+ profile = f'{self.rsiz}'
1674
+ else:
1675
+ # profile unknown
1676
+ profile = f'{self.rsiz} (invalid)'
1670
1677
  msg = msg.format(
1671
1678
  profile=profile,
1672
1679
  height=self.ysiz, width=self.xsiz,
glymur/jp2box.py CHANGED
@@ -1259,7 +1259,7 @@ class FileTypeBox(Jp2kBox):
1259
1259
  """
1260
1260
  box_id = 'ftyp'
1261
1261
  longname = 'File Type'
1262
- _valid_cls = ['jp2 ', 'jpx ', 'jpxb']
1262
+ _valid_cls = ['jp2 ', 'jph ', 'jpx ', 'jpxb']
1263
1263
 
1264
1264
  def __init__(
1265
1265
  self, brand='jp2 ', minor_version=0, compatibility_list=None,
@@ -1304,16 +1304,19 @@ class FileTypeBox(Jp2kBox):
1304
1304
  return text
1305
1305
 
1306
1306
  def _validate(self, writing=False):
1307
- """Validate the box before writing to file."""
1308
- if self.brand not in ['jp2 ', 'jpx ']:
1307
+ """
1308
+ Validate the box before writing to file.
1309
+ """
1310
+ if self.brand not in ['jp2 ', 'jpx ', 'jph ']:
1309
1311
  msg = (
1310
1312
  f"The file type brand was '{self.brand}'. "
1311
- f"It should be either 'jp2 ' or 'jpx '."
1313
+ f"It should be either 'jp2 ', 'jpx ', or 'jph '."
1312
1314
  )
1313
1315
  if writing:
1314
1316
  raise InvalidJp2kError(msg)
1315
1317
  else:
1316
1318
  warnings.warn(msg, UserWarning)
1319
+
1317
1320
  for item in self.compatibility_list:
1318
1321
  if item not in self._valid_cls:
1319
1322
  msg = (
glymur/jp2k.py CHANGED
@@ -206,13 +206,13 @@ class Jp2k(Jp2kr):
206
206
  # Must be determined when writing.
207
207
  self._shape = None
208
208
 
209
- # If there already was a shape attribute, then don't mess with it,
210
- # it was set by the reader superclass.
211
-
212
- if self.filename[-4:].endswith(('.jp2', '.JP2', '.jpx', 'JPX')):
213
- self._codec_format = opj2.CODEC_JP2
214
- else:
215
- self._codec_format = opj2.CODEC_J2K
209
+ if not hasattr(self, '_codec_format'):
210
+ # Only set codec format if the superclass has not done so, i.e.
211
+ # we are writing instead of reading.
212
+ if self.filename[-4:].endswith(('.jp2', '.JP2', '.jpx', 'JPX')):
213
+ self._codec_format = opj2.CODEC_JP2
214
+ else:
215
+ self._codec_format = opj2.CODEC_J2K
216
216
 
217
217
  self._validate_kwargs()
218
218
 
glymur/version.py CHANGED
@@ -20,7 +20,7 @@ from .lib import 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.13.3"
23
+ version = "0.13.4"
24
24
 
25
25
  version_tuple = parse(version).release
26
26