diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 7a96571..c3eae6c 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -9,6 +9,7 @@ ChangeLog * Added lxml requirement. * added set_printoptions, get_printoptions function * dropped support for Python 2.6, added support for Python 3.4 + * dropped support for OpenJPEG versions 1.3 and 1.4 * dropped windows support (it might work, it might not, I don't much care) * added write support for JP2 UUID, dataEntryURL, palette, and component mapping boxes * added read/write support for JPX free, number list, and data reference boxes diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst index 38193eb..10df117 100644 --- a/docs/source/introduction.rst +++ b/docs/source/introduction.rst @@ -14,17 +14,7 @@ XMP UUIDs. There is some very limited support for reading JPX metadata. Glymur 0.6 works on Python versions 2.7, 3.3 and 3.4. If you have Python 2.6, you should use the 0.5 series of Glymur. -OpenJPEG Installation -===================== -Glymur will read JPEG 2000 images with versions 1.3, 1.4, 1.5, 2.0, -and the trunk/development version of OpenJPEG. Writing images is -only supported with the 1.5 or better, however, and the trunk/development -version of OpenJPEG is strongly recommended. For more information about -OpenJPEG, please consult http://www.openjpeg.org. - -If you use MacPorts or if you have a sufficiently recent version of -Linux, your package manager should already provide you with a version of -OpenJPEG 1.X which glymur can already use. +For more information about OpenJPEG, please consult http://www.openjpeg.org. Glymur Installation =================== diff --git a/glymur/jp2k.py b/glymur/jp2k.py index 7522d35..3467426 100644 --- a/glymur/jp2k.py +++ b/glymur/jp2k.py @@ -772,19 +772,6 @@ class Jp2k(Jp2kBox): """ self._subsampling_sanity_check() - if rlevel != 0: - # Must check the specified rlevel against the maximum. - # OpenJPEG 1.3 will segfault if rlevel is too high. - codestream = self.get_codestream() - max_rlevel = codestream.segment[2].spcod[4] - if rlevel == -1: - # -1 is shorthand for the largest rlevel - rlevel = max_rlevel - if rlevel < -1 or rlevel > max_rlevel: - msg = "rlevel must be in the range [-1, {0}] for this image." - msg = msg.format(max_rlevel) - raise IOError(msg) - with ExitStack() as stack: try: # Set decoding parameters. diff --git a/glymur/test/test_jp2k.py b/glymur/test/test_jp2k.py index dd55299..433531f 100644 --- a/glymur/test/test_jp2k.py +++ b/glymur/test/test_jp2k.py @@ -386,15 +386,9 @@ class TestJp2k(unittest.TestCase): # The file in question has multiple codestreams. jpx = Jp2k(self.jpxfile) data = jpx.read() - 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)) + self.assertEqual(data.shape, (1024, 1024, 3)) -@unittest.skipIf(re.match(r"""1\.[01234]""", glymur.version.openjpeg_version), - "Requires at least version 1.5") class TestJp2k_write(unittest.TestCase): """Write tests, can be run by versions 1.5+""" diff --git a/glymur/test/test_opj_suite.py b/glymur/test/test_opj_suite.py index df4cde2..5cc9250 100644 --- a/glymur/test/test_opj_suite.py +++ b/glymur/test/test_opj_suite.py @@ -381,11 +381,7 @@ class TestSuite(unittest.TestCase): jfile = opj_data_file('input/conformance/file9.jp2') jp2k = Jp2k(jfile) jpdata = jp2k.read() - 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)) + self.assertEqual(jpdata.shape, (512, 768, 3)) def test_NR_DEC_Bretagne2_j2k_1_decode(self): jfile = opj_data_file('input/nonregression/Bretagne2.j2k') diff --git a/glymur/test/test_opj_suite_neg.py b/glymur/test/test_opj_suite_neg.py index d31ea48..c93d624 100644 --- a/glymur/test/test_opj_suite_neg.py +++ b/glymur/test/test_opj_suite_neg.py @@ -23,8 +23,6 @@ from glymur import Jp2k import glymur -@unittest.skipIf(re.match(r"""1\.[01234]""", glymur.version.openjpeg_version), - "Functionality not implemented for 1.3, 1.4") @unittest.skipIf(OPJ_DATA_ROOT is None, "OPJ_OPJ_DATA_ROOT environment variable not set") class TestSuiteNegative2pointzero(unittest.TestCase): @@ -48,8 +46,6 @@ class TestSuiteNegative2pointzero(unittest.TestCase): j.write(data, psnr=[30, 35, 40], cratios=[2, 3, 4]) -@unittest.skipIf(re.match(r"""1\.[01234]""", glymur.version.openjpeg_version), - "Functionality not implemented for 1.3, 1.4") @unittest.skipIf(OPJ_DATA_ROOT is None, "OPJ_OPJ_DATA_ROOT environment variable not set") class TestSuiteNegative(unittest.TestCase): diff --git a/glymur/test/test_opj_suite_write.py b/glymur/test/test_opj_suite_write.py index 220115c..1db11c4 100644 --- a/glymur/test/test_opj_suite_write.py +++ b/glymur/test/test_opj_suite_write.py @@ -249,9 +249,6 @@ class TestSuiteNegative2pointzero(unittest.TestCase): @unittest.skipIf(os.name == "nt", "no write support on windows, period") -@unittest.skipIf(re.match(r"""1\.[01234]\.\d""", - glymur.version.openjpeg_version) is not None, - "Writing only supported with openjpeg version 1.5+.") @unittest.skipIf(NO_READ_BACKEND, NO_READ_BACKEND_MSG) @unittest.skipIf(OPJ_DATA_ROOT is None, "OPJ_DATA_ROOT environment variable not set")