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.
Python Ruby Shell Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
debian added changelog entry Aug 23, 2017
doc updated User Manual Aug 22, 2017
example_files moved dirs debian, doc, example_files and makefile to top-level dir a… May 3, 2013
jpylyzer and yet more pylint fixes Aug 23, 2017
logo Added safeguard to ensure scriptName is defined when called from Java… Feb 12, 2014
vagrant removed --single-branch as git version on VM doesnt like it Aug 22, 2017
xsd updated schema to 1-1, fixed misnamed properties element Dec 4, 2015
.gitignore removed .egginfo dir and added pattern to .gitignore Aug 17, 2017
.opf.yml Added .opf.yml May 13, 2013
.travis.yml Now using correct Travis script: key. Sep 7, 2017
BUILD_HOWTO_LINUX.md updated Linux build instructions Aug 16, 2017
BUILD_HOWTO_WINDOWS.md Added build how-to Aug 14, 2017
LICENSE bumped version numbers, added licensing info for Python Six Jan 5, 2016
MANIFEST.in updated changelog, README, version number Mar 25, 2015
Makefile Moved PyInstaller calls to a separate shell script. Oct 3, 2013
README.md updated README 9again) Aug 23, 2017
build-with-pyinstaller.sh updated build-with-pyinstaller.sh Aug 22, 2017
buildwin.sh fixed naming of windows binary zip files Aug 23, 2017
cli.py Some PEP8 fixes Aug 23, 2017
howto-prepare-release.md more stylistic improvements Aug 23, 2017
jpylyzer_win32.spec moved cli runner script up one level and referrred to it in Windows s… Aug 22, 2017
jpylyzer_win64.spec moved cli runner script up one level and referrred to it in Windows s… Aug 22, 2017
package-pypi.sh updated User Manual Aug 22, 2017
setup.py added __main__.py Aug 18, 2017
sonar-project.properties updated sonar properties Aug 23, 2017
travis-build.sh modified Travis script, no idea if this works Aug 22, 2017

README.md

jpylyzer

About

Jpylyzer is a JP2 (JPEG 2000 Part 1) image validator and properties extractor. Its development was partially supported by the SCAPE Project. The SCAPE project is co-funded by the European Union under FP7 ICT-2009.4.1 (Grant Agreement number 270137).

Jpylyzer homepage

Please visit the jpylyzer homepage for links to the most recent package downloads (Debian packages and Windows binaries), and a User Manual which documents all aspects of the software:

http://jpylyzer.openpreservation.org/

Cd Status

  • Build Status Travis-CI

  • Build Status OPF Jenkins

Command line use

Usage

usage: jpylyzer [-h] [--verbose] [--recurse] [--wrapper] [--nullxml]
                   [--nopretty] [--version] jp2In [jp2In ...]

Positional arguments

jp2In : input JP2 image(s), may be one or more (whitespace-separated) path expressions; prefix wildcard (*) with backslash (\) in Linux.

Optional arguments

-h, --help : show this help message and exit;

-v, --version : show program's version number and exit;

--verbose : report test results in verbose format;

--recurse, -r : when analysing a directory, recurse into subdirectories (implies --wrapper)

--wrapper, -w : wrap the output for individual image(s) in 'results' XML element.

--nullxml : extract null-terminated XML content from XML and UUID boxes (doesn't affect validation)

--nopretty : suppress pretty-printing of XML output

Output

Output is directed to the standard output device (stdout).

Example

jpylyzer.py rubbish.jp2 > rubbish.xml

In the above example, output is redirected to the file 'rubbish.xml'.

Outline of output elements

  1. toolInfo: tool name (jpylyzer) + version.
  2. fileInfo: name, path, size and last modified time/date of input file.
  3. isValidJP2: True / False flag indicating whether file is valid JP2.
  4. tests: tree of test outcomes, expressed as True / False flags. A file is considered valid JP2 only if all tests return True. Tree follows JP2 box structure. By default only tests that returned False are reported, which results in an empty tests element for files that are valid JP2. Use the --verbose flag to get all test results.
  5. properties: tree of image properties. Follows JP2 box structure. Naming of properties follows ISO/IEC 15444-1 Annex I (JP2 file format syntax) and Annex A (Codestream syntax).

Using jpylyzer as a Python module

In order to use jpylyzer in your own Python programs, first install it with pip. Then import jpylyzer into your code by adding:

from jpylyzer import jpylyzer

Subsequently you can call any function that is defined in jpylyzer.py. In practice you will most likely only need the checkOneFile function. The following minimal script shows how this works:

from jpylyzer import jpylyzer
# Define JP2
myFile = "/home/johan/jpylyzer-test-files/aware.jp2"

# Analyse with jpylyzer, result to Element object
myResult = jpylyzer.checkOneFile(myFile)

# Return image height value
imageHeight = myResult.findtext('./properties/jp2HeaderBox/imageHeaderBox/height')
print(imageHeight)

Debian packages build process

The Vagrant directory of this repo contains instructions on how to build Debian packages using VirtualBox and Vagrant. A Vagrantfile and provisioning scripts are included for a number of target platforms, which should make the process of building the packages fairly easy.

Steps in preparing a jpylyzer release

See instructions here