openpreserve / jpylyzer

JP2 (JPEG 2000 Part 1) validator and properties extractor. Jpylyzer was specifically created to check that a JP2 file really conforms to the format's specifications. Additionally jpylyzer is able to extract technical characteristics.
http://jpylyzer.openpreservation.org/
Other
69 stars 28 forks source link

foundExpectedNumberOfTileParts clarification #168

Closed VirtualTim closed 2 years ago

VirtualTim commented 4 years ago

According to the user manual:

Number of tile-parts of a tile in the codestream (value of 0 indicates that number of tile-parts of tile in the codestream is not defined in current header)

And the spec (Table A.6):

Value (0): Number of tile-parts of this tile in the codestream is not defined in this header Value (1-255): Number of tile-parts of this tile in the codestream

Looking at the foundExpectedNumberOfTileParts test the first case is not accounted for. A jp2 with tnsot=0 is always going to be marked as invalid.

So am I misunderstanding the spec, or is this case unaccounted for? It sounds to me like the test should be for len(set(tilePartsPerTileExpected.items())) == len(set(tilePartsPerTileFound.items()))) or len(set(tilePartsPerTileFound.items()))) == 0

bitsgalore commented 4 years ago

@VirtualTim Good call, not 100% sure but I think you're right. Will look into this for the next release. Thanks for reporting!

bitsgalore commented 2 years ago

Done, see:

https://github.com/openpreserve/jpylyzer/commit/89ab111bb9d181f17481842db52db8c015f30562

I also added an example file to the jpylyzer test corpus:

https://github.com/openpreserve/jpylyzer-test-files/blob/master/oj-tnsot-0.jp2