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

Output elements missing for QCD marker #129

Closed bitsgalore closed 4 years ago

bitsgalore commented 4 years ago

Command:

  python3 ~/jpylyzer/cli.py --recurse ~/jpylyzer-test-files/ > jpylyzer.xml
  xmllint --noout --schema ~/jpylyzer/xsd/jpylyzer-v-2-0.xsd  jpylyzer.xml

Result:

jpylyzer.xml:3404: element qcd: Schemas validity error : Element '{http://openpreservation.org/ns/jpylyzer/v2/}qcd': Missing child element(s). Expected is one of ( {http://openpreservation.org/ns/jpylyzer/v2/}mu, {http://openpreservation.org/ns/jpylyzer/v2/}epsilon ).
jpylyzer.xml:17090: element qcd: Schemas validity error : Element '{http://openpreservation.org/ns/jpylyzer/v2/}qcd': Missing child element(s). Expected is one of ( {http://openpreservation.org/ns/jpylyzer/v2/}mu, {http://openpreservation.org/ns/jpylyzer/v2/}epsilon ).
jpylyzer.xml fails to validate

Turns out for some images the qcd element doesn't contain mu or epsilon child elements.

bitsgalore commented 4 years ago

Affects following files:

is_jpx.jp2

            <qcd>
                <lqcd>4</lqcd>
                <qStyle>no quantization</qStyle>
                <guardBits>2</guardBits>
            </qcd>

oj-tileindex-error-2.jp2

            <qcd>
                <lqcd>4</lqcd>
                <qStyle>no quantization</qStyle>
                <guardBits>2</guardBits>
            </qcd>
bitsgalore commented 4 years ago

Happens if levels equals 0. Fixed by https://github.com/openpreserve/jpylyzer/commit/733f16d0d2db53ff1480557f908ed9c3d9ca1db1.