diff --git a/CHANGES.txt b/CHANGES.txt index f6c3728..1febdfb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,12 +2,12 @@ Feb 09, 2014 - Removed support for Python 2.6. Added write support for JP2 UUID, DataEntryURL, Palette and Component Mapping boxes, JPX Association, NumberList and DataReference boxes. Added read support for JPX free, number list, data reference, fragment - table, and fragment list boxes. Added get_printoptions, - set_printoptions functions. Palette box now a 2D numpy array - instead of a list of 1D arrays. JP2 super box constructors now - take optional box list argument. Fixed bug where JPX files - with more than one codestream but advertising jp2 compatibility - were not being read. + table, and fragment list boxes. Improved JPX Reader Requirements box + support. Added get_printoptions, set_printoptions functions. + Palette box now a 2D numpy array instead of a list of 1D arrays. + JP2 super box constructors now take optional box list argument. + Fixed bug where JPX files with more than one codestream but + advertising jp2 compatibility were not being read. Jan 28, 2014 - v0.5.10 Fixed bad warning when reader requirements box mask length is unsupported. diff --git a/glymur/jp2box.py b/glymur/jp2box.py index 12613fa..53bad9f 100644 --- a/glymur/jp2box.py +++ b/glymur/jp2box.py @@ -1861,6 +1861,14 @@ class ReaderRequirementsBox(Jp2kBox): if _printoptions['short'] == True: return msg + msg += '\n Fully Understands Aspect Mask: {0}'.format(self.fuam) + msg += '\n Display Completely Mask: {0}'.format(self.dcm) + + msg += '\n Standard Features and Masks:' + for j in range(len(self.standard_flag)): + sfl = self.standard_flag[j] + mask = self.standard_mask[j] + msg += '\n Feature {0:03d}: {1}'.format(sfl, mask) msg += '\n Standard Features:' for j in range(len(self.standard_flag)): diff --git a/glymur/test/fixtures.py b/glymur/test/fixtures.py index 182a04f..0d5069b 100644 --- a/glymur/test/fixtures.py +++ b/glymur/test/fixtures.py @@ -682,3 +682,17 @@ JP2 Header Box (jp2h) @ (32, 45) UUID Box (uuid) @ (77, 3146) UUID: be7acfcb-97a9-42e8-9c71-999491e3afac (XMP) Contiguous Codestream Box (jp2c) @ (3223, 1132296)""" + +# Output of reader requirement printing for file7.jp2 +file7_rreq = r"""Reader Requirements Box (rreq) @ (44, 24) + Fully Understands Aspect Mask: 160 + Display Completely Mask: 192 + Standard Features and Masks: + Feature 005: 128 + Feature 060: 96 + Feature 043: 64 + Standard Features: + Feature 005: Unrestricted JPEG 2000 Part 1 codestream, ITU-T Rec. T.800 | ISO/IEC 15444-1 + Feature 060: e-sRGB enumerated colorspace + Feature 043: (Deprecated) compositing layer uses restricted ICC profile + Vendor Features:""" diff --git a/glymur/test/test_printing.py b/glymur/test/test_printing.py index 56fa4f0..26156dc 100644 --- a/glymur/test/test_printing.py +++ b/glymur/test/test_printing.py @@ -738,20 +738,7 @@ class TestPrinting(unittest.TestCase): with patch('sys.stdout', new=StringIO()) as fake_out: print(j.box[2]) actual = fake_out.getvalue().strip() - lines = ['Reader Requirements Box (rreq) @ (44, 24)', - ' Standard Features:', - ' Feature 005: ' - + 'Unrestricted JPEG 2000 Part 1 codestream, ' - + 'ITU-T Rec. T.800 | ISO/IEC 15444-1', - ' Feature 060: e-sRGB enumerated colorspace', - - ' Feature 043: ' - + '(Deprecated) ' - + 'compositing layer uses restricted ICC profile', - - ' Vendor Features:'] - expected = '\n'.join(lines) - self.assertEqual(actual, expected) + self.assertEqual(actual, fixtures.file7_rreq) @unittest.skipIf(OPJ_DATA_ROOT is None, "OPJ_DATA_ROOT environment variable not set")