From a9d62da2c8a538684d0057daddc3a49e5c403812 Mon Sep 17 00:00:00 2001 From: John Evans Date: Mon, 3 Feb 2014 08:36:18 -0500 Subject: [PATCH] openjpeg 1.3 does not apply the palette. Closes #147 --- glymur/test/test_jp2k.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glymur/test/test_jp2k.py b/glymur/test/test_jp2k.py index 9ebe774..c664de9 100644 --- a/glymur/test/test_jp2k.py +++ b/glymur/test/test_jp2k.py @@ -382,7 +382,11 @@ class TestJp2k(unittest.TestCase): warnings.simplefilter("ignore") jpx = Jp2k(self.jpxfile) data = jpx.read() - self.assertEqual(data.shape, (1024, 1024, 3)) + if re.match(r"""1\.[0123]""", glymur.version.openjpeg_version): + # openjpeg 1.3 doesn't apply the palette, so it's a 2D image here + self.assertEqual(data.shape, (1024, 1024)) + else: + self.assertEqual(data.shape, (1024, 1024, 3)) @unittest.skipIf(os.name == "nt", "NamedTemporaryFile issue on windows") def test_unrecognized_exif_tag(self):