Merge branch 'issue253' into devel
This commit is contained in:
commit
1ce3113f95
3 changed files with 19 additions and 18 deletions
|
|
@ -37,6 +37,19 @@ except:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
# The Cinema2K/4K tests seem to need the freeimage backend to skimage.io
|
||||||
|
# in order to work.
|
||||||
|
try:
|
||||||
|
import skimage.io
|
||||||
|
if 'freeimage' in skimage.io.find_available_plugins(loaded=True).keys():
|
||||||
|
skimage.io.use_plugin('freeimage', 'imread')
|
||||||
|
NO_SKIMAGE_FREEIMAGE_SUPPORT = False
|
||||||
|
else:
|
||||||
|
NO_SKIMAGE_FREEIMAGE_SUPPORT = True
|
||||||
|
except ((ImportError, RuntimeError)):
|
||||||
|
NO_SKIMAGE_FREEIMAGE_SUPPORT = True
|
||||||
|
|
||||||
|
|
||||||
def _indent(textstr):
|
def _indent(textstr):
|
||||||
"""
|
"""
|
||||||
Indent a string.
|
Indent a string.
|
||||||
|
|
|
||||||
|
|
@ -17,15 +17,9 @@ import warnings
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
try:
|
|
||||||
import skimage.io
|
|
||||||
skimage.io.use_plugin('freeimage', 'imread')
|
|
||||||
_HAS_SKIMAGE_FREEIMAGE_SUPPORT = True
|
|
||||||
except ((ImportError, RuntimeError)):
|
|
||||||
_HAS_SKIMAGE_FREEIMAGE_SUPPORT = False
|
|
||||||
|
|
||||||
from .fixtures import OPJ_DATA_ROOT, opj_data_file, read_image
|
from .fixtures import OPJ_DATA_ROOT, opj_data_file, read_image
|
||||||
from .fixtures import NO_READ_BACKEND, NO_READ_BACKEND_MSG
|
from .fixtures import NO_READ_BACKEND, NO_READ_BACKEND_MSG
|
||||||
|
from .fixtures import NO_SKIMAGE_FREEIMAGE_SUPPORT
|
||||||
|
|
||||||
from glymur import Jp2k
|
from glymur import Jp2k
|
||||||
import glymur
|
import glymur
|
||||||
|
|
@ -44,7 +38,7 @@ class TestSuiteNegative(unittest.TestCase):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipIf(not _HAS_SKIMAGE_FREEIMAGE_SUPPORT,
|
@unittest.skipIf(NO_SKIMAGE_FREEIMAGE_SUPPORT,
|
||||||
"Cannot read input image without scikit-image/freeimage")
|
"Cannot read input image without scikit-image/freeimage")
|
||||||
@unittest.skipIf(os.name == "nt", "Temporary file issue on window.")
|
@unittest.skipIf(os.name == "nt", "Temporary file issue on window.")
|
||||||
def test_cinema2K_bad_frame_rate(self):
|
def test_cinema2K_bad_frame_rate(self):
|
||||||
|
|
|
||||||
|
|
@ -15,21 +15,15 @@ import warnings
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
try:
|
|
||||||
import skimage.io
|
|
||||||
skimage.io.use_plugin('freeimage', 'imread')
|
|
||||||
_HAS_SKIMAGE_FREEIMAGE_SUPPORT = True
|
|
||||||
except ((ImportError, RuntimeError)):
|
|
||||||
_HAS_SKIMAGE_FREEIMAGE_SUPPORT = False
|
|
||||||
|
|
||||||
from .fixtures import read_image, NO_READ_BACKEND, NO_READ_BACKEND_MSG
|
from .fixtures import read_image, NO_READ_BACKEND, NO_READ_BACKEND_MSG
|
||||||
from .fixtures import OPJ_DATA_ROOT, opj_data_file
|
from .fixtures import OPJ_DATA_ROOT, NO_SKIMAGE_FREEIMAGE_SUPPORT
|
||||||
|
from .fixtures import opj_data_file
|
||||||
from . import fixtures
|
from . import fixtures
|
||||||
|
|
||||||
from glymur import Jp2k
|
from glymur import Jp2k
|
||||||
import glymur
|
import glymur
|
||||||
|
|
||||||
@unittest.skipIf(not _HAS_SKIMAGE_FREEIMAGE_SUPPORT,
|
@unittest.skipIf(NO_SKIMAGE_FREEIMAGE_SUPPORT,
|
||||||
"Cannot read input image without scikit-image/freeimage")
|
"Cannot read input image without scikit-image/freeimage")
|
||||||
@unittest.skipIf(os.name == "nt", "no write support on windows, period")
|
@unittest.skipIf(os.name == "nt", "no write support on windows, period")
|
||||||
@unittest.skipIf(re.match(r'''(1|2.0.0)''',
|
@unittest.skipIf(re.match(r'''(1|2.0.0)''',
|
||||||
|
|
@ -230,7 +224,7 @@ class TestSuiteWriteCinema(unittest.TestCase):
|
||||||
codestream = j.get_codestream()
|
codestream = j.get_codestream()
|
||||||
self.check_cinema2k_codestream(codestream, (1998, 1080))
|
self.check_cinema2k_codestream(codestream, (1998, 1080))
|
||||||
|
|
||||||
@unittest.skipIf(not _HAS_SKIMAGE_FREEIMAGE_SUPPORT,
|
@unittest.skipIf(NO_SKIMAGE_FREEIMAGE_SUPPORT,
|
||||||
"Cannot read input image without scikit-image/freeimage")
|
"Cannot read input image without scikit-image/freeimage")
|
||||||
@unittest.skipIf(os.name == "nt", "Temporary file issue on window.")
|
@unittest.skipIf(os.name == "nt", "Temporary file issue on window.")
|
||||||
@unittest.skipIf(not re.match("(1.5|2.0.0)", glymur.version.openjpeg_version),
|
@unittest.skipIf(not re.match("(1.5|2.0.0)", glymur.version.openjpeg_version),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue