Use monkey-patched openjpeg version when library not available. Closes #92
This commit is contained in:
parent
6581540f34
commit
3f417a30b1
1 changed files with 5 additions and 3 deletions
|
|
@ -30,6 +30,7 @@ import numpy as np
|
||||||
from glymur import Jp2k
|
from glymur import Jp2k
|
||||||
import glymur
|
import glymur
|
||||||
|
|
||||||
|
from .fixtures import OPENJPEG_VERSION
|
||||||
from .fixtures import OPENJP2_IS_V2_OFFICIAL
|
from .fixtures import OPENJP2_IS_V2_OFFICIAL
|
||||||
|
|
||||||
from .fixtures import *
|
from .fixtures import *
|
||||||
|
|
@ -7801,7 +7802,8 @@ class TestSuite15(unittest.TestCase):
|
||||||
jfile = os.path.join(data_root, 'input/conformance/file9.jp2')
|
jfile = os.path.join(data_root, 'input/conformance/file9.jp2')
|
||||||
jp2k = Jp2k(jfile)
|
jp2k = Jp2k(jfile)
|
||||||
jpdata = jp2k.read()
|
jpdata = jp2k.read()
|
||||||
if glymur.lib.openjpeg.version().startswith('1.3'):
|
if re.match('[01]\.3', OPENJPEG_VERSION):
|
||||||
|
# Version 1.3 reads in the image as the palette indices.
|
||||||
self.assertEqual(jpdata.shape, (512, 768))
|
self.assertEqual(jpdata.shape, (512, 768))
|
||||||
else:
|
else:
|
||||||
self.assertEqual(jpdata.shape, (512, 768, 3))
|
self.assertEqual(jpdata.shape, (512, 768, 3))
|
||||||
|
|
@ -7840,7 +7842,7 @@ class TestSuite15(unittest.TestCase):
|
||||||
data = jp2.read()
|
data = jp2.read()
|
||||||
self.assertTrue(True)
|
self.assertTrue(True)
|
||||||
|
|
||||||
@unittest.skipIf(int(glymur.lib.openjpeg.version().split('.')[1]) < 5,
|
@unittest.skipIf(re.match('[01]\.[34]', OPENJPEG_VERSION),
|
||||||
"Segfaults openjpeg 1.4 and earlier.")
|
"Segfaults openjpeg 1.4 and earlier.")
|
||||||
def test_NR_DEC_broken2_jp2_5_decode(self):
|
def test_NR_DEC_broken2_jp2_5_decode(self):
|
||||||
# Null pointer access
|
# Null pointer access
|
||||||
|
|
@ -7863,7 +7865,7 @@ class TestSuite15(unittest.TestCase):
|
||||||
with self.assertRaises(ValueError) as ce:
|
with self.assertRaises(ValueError) as ce:
|
||||||
d = j.read()
|
d = j.read()
|
||||||
|
|
||||||
@unittest.skipIf(int(glymur.lib.openjpeg.version().split('.')[1]) < 5,
|
@unittest.skipIf(re.match('[01]\.[34]', OPENJPEG_VERSION),
|
||||||
"Segfaults openjpeg 1.4 and earlier.")
|
"Segfaults openjpeg 1.4 and earlier.")
|
||||||
def test_NR_DEC_broken4_jp2_7_decode(self):
|
def test_NR_DEC_broken4_jp2_7_decode(self):
|
||||||
# Null pointer access
|
# Null pointer access
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue