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

Catch mmap failure for empty files #77

Closed stweil closed 8 years ago

stweil commented 8 years ago

Calling mmap with an empty file raises a ValueError exception.

Signed-off-by: Stefan Weil sw@weilnetz.de

stweil commented 8 years ago

Maybe a test case for empty JP2 files (results from some broken software) would be reasonable.

bitsgalore commented 8 years ago

Thanks, I had just come across this issue myself , and was working on a fix already. Anyway, I liked your patch better than mine, so I decided to use that.

I'll add an empty file to the test cases.

bitsgalore commented 8 years ago

Added empty JP2 test case: https://github.com/openpreserve/jpylyzer-test-files/commit/ff4c37abd3871443d78d314254115a0822aeadc6