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

Detection of the lack of libraries (mmap and six) in Jython. #162

Closed tledoux closed 3 years ago

tledoux commented 4 years ago

In order to use jpylyzer in Java using Jython, the use of the mmap library should be avoid. Indeed the mmap is not supported by Jython (see https://bugs.jython.org/issue1854873).

To simplify the detection for the lack of libraries in Jython, the ImportError exception is catch and a flag is set. When the mmap library is not available, files are directly read in memory (method used before the 1.14 version of jylyzer).

An example java program is provided to test.

Takes also care of the six library which doesn't work with Jython Correct some E302 pep8 warnings

tledoux commented 4 years ago

Reopened it because the deletion of the dev2 branch has closed it...

bitsgalore commented 3 years ago

Merged PR into jpylyzer 2.1 dev branch https://github.com/openpreserve/jpylyzer/commit/3a98450a513d7763e10364c1e68ad97e43646c9b