This commit is contained in:
parent
944bf95d45
commit
b500287700
1 changed files with 11 additions and 14 deletions
|
|
@ -412,8 +412,8 @@ class Jp2k(Jp2kBox):
|
||||||
|
|
||||||
Raises
|
Raises
|
||||||
------
|
------
|
||||||
glymur.LibraryNotFoundError
|
glymur.jp2k.LibraryNotFoundError
|
||||||
If glymur is unable to load the openjp2 library.
|
if glymur is unable to load an openjpeg library suitable for writing
|
||||||
"""
|
"""
|
||||||
if opj2.OPENJP2 is None and opj.OPENJPEG is None:
|
if opj2.OPENJP2 is None and opj.OPENJPEG is None:
|
||||||
raise LibraryNotFoundError("You must have at least version 1.5 of "
|
raise LibraryNotFoundError("You must have at least version 1.5 of "
|
||||||
|
|
@ -963,9 +963,8 @@ class Jp2k(Jp2kBox):
|
||||||
|
|
||||||
Raises
|
Raises
|
||||||
------
|
------
|
||||||
glymur.LibraryNotFoundError
|
glymur.jp2k.LibraryNotFoundError
|
||||||
If glymur is unable to load either the openjpeg or openjp2
|
if glymur is unable to load an openjpeg library suitable for reading
|
||||||
libraries.
|
|
||||||
IOError
|
IOError
|
||||||
If the image has differing subsample factors.
|
If the image has differing subsample factors.
|
||||||
|
|
||||||
|
|
@ -984,15 +983,13 @@ class Jp2k(Jp2kBox):
|
||||||
>>> thumbnail.shape
|
>>> thumbnail.shape
|
||||||
(728, 1296, 3)
|
(728, 1296, 3)
|
||||||
"""
|
"""
|
||||||
|
if opj2.OPENJP2 is None and opj.OPENJPEG is None:
|
||||||
|
raise LibraryNotFoundError("Cannot load the OpenJPEG library.")
|
||||||
|
|
||||||
if opj2.OPENJP2 is not None:
|
if opj2.OPENJP2 is not None:
|
||||||
img = self._read_openjp2(**kwargs)
|
img = self._read_openjp2(**kwargs)
|
||||||
elif opj.OPENJPEG is not None:
|
|
||||||
img = self._read_openjpeg(**kwargs)
|
|
||||||
else:
|
else:
|
||||||
raise LibraryNotFoundError("You must have either a recent version "
|
img = self._read_openjpeg(**kwargs)
|
||||||
"of OpenJPEG or the development "
|
|
||||||
"version of OpenJP2 installed before "
|
|
||||||
"using this functionality.")
|
|
||||||
return img
|
return img
|
||||||
|
|
||||||
def _subsampling_sanity_check(self):
|
def _subsampling_sanity_check(self):
|
||||||
|
|
@ -1282,12 +1279,12 @@ class Jp2k(Jp2kBox):
|
||||||
|
|
||||||
Raises
|
Raises
|
||||||
------
|
------
|
||||||
glymur.LibraryNotFoundError
|
glymur.jp2k.LibraryNotFoundError
|
||||||
If glymur is unable to load the openjp2 library.
|
if glymur is unable to load an openjpeg library suitable for reading
|
||||||
"""
|
"""
|
||||||
if version.openjpeg_version_tuple[0] < 2:
|
if version.openjpeg_version_tuple[0] < 2:
|
||||||
raise LibraryNotFoundError("You must have at least version 2.0.0 "
|
raise LibraryNotFoundError("You must have at least version 2.0.0 "
|
||||||
"of OpenJP2 installed before using "
|
"of OpenJPEG installed before using "
|
||||||
"this functionality.")
|
"this functionality.")
|
||||||
|
|
||||||
dparam = self._populate_dparam(rlevel, ignore_pclr_cmap_cdef,
|
dparam = self._populate_dparam(rlevel, ignore_pclr_cmap_cdef,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue