From fe6c607e67e1b532619462576b89b8ed2d058680 Mon Sep 17 00:00:00 2001 From: John Evans Date: Sun, 15 Sep 2013 12:33:29 -0400 Subject: [PATCH] Openjpeg 1.3 reads this image as indices, not RGB. #116 --- glymur/test/test_opj_suite.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glymur/test/test_opj_suite.py b/glymur/test/test_opj_suite.py index 36f0a7b..a5daf3e 100644 --- a/glymur/test/test_opj_suite.py +++ b/glymur/test/test_opj_suite.py @@ -645,7 +645,11 @@ class TestSuite(unittest.TestCase): jfile = opj_data_file('input/conformance/file9.jp2') jp2k = Jp2k(jfile) jpdata = jp2k.read() - self.assertEqual(jpdata.shape, (512, 768, 3)) + if re.match(r"""1\.3""", glymur.version.openjpeg_version): + # Version 1.3 reads the indexed image as indices, not as RGB. + self.assertEqual(jpdata.shape, (512, 768)) + else: + self.assertEqual(jpdata.shape, (512, 768, 3)) def test_NR_DEC_Bretagne2_j2k_1_decode(self): jfile = opj_data_file('input/nonregression/Bretagne2.j2k')