harvard-lts / fits

File Information Tool Set
http://fitstool.org
GNU Lesser General Public License v2.1
91 stars 46 forks source link

Jhove returns valid for JP2 even after severe error #372

Open paul-aloisio opened 1 year ago

paul-aloisio commented 1 year ago

In FITS 1.6.0 when Jhove encounters an unhandled exception while checking the validity of a JP2, the recorded response is still "valid and well-formed". There's information in a 'message' field, but that is not accounted for.

This is a section of the FITS output for the file linked below:

  <filestatus>
    <well-formed toolname="Jhove" toolversion="1.26.1" status="CONFLICT">true</well-formed>
    <well-formed toolname="jpylyzer" toolversion="2.1.0" status="CONFLICT">false</well-formed>
    <valid toolname="Jhove" toolversion="1.26.1" status="CONFLICT">true</valid>
    <valid toolname="jpylyzer" toolversion="2.1.0" status="CONFLICT">false</valid>
    <message toolname="Jhove" toolversion="1.26.1" status="SINGLE_RESULT">Validation ended prematurely due to an unhandled exception. severity=error</message>
  </filestatus>

The entire FITS output and the console error are in the attached zip.

https://drive.google.com/file/d/1pzRxiFr_EK0IwWjTRgFr7WyGPLgu60jW/view?usp=share_link Jhove_FITS_JP2_error_output.zip

pwinckles commented 1 year ago

@paul-aloisio In this case, Jhove is returning <status>Unknown</status>, which is being mapped to FITS as valid and well-formed. How would you like this mapped? Invalid and not well-formed? Omitted? Unfortunately, the options are binary in FITS.

paul-aloisio commented 1 year ago

Since jpylyzer correctly identifies the jp2 as invalid, this particular case seems less important if there's no clear answer. I am opening an issue with Jhove and connecting it to this one in which they unhandled exception is reported: https://github.com/openpreserve/jhove/issues/712

It would be best if Jhove just handled the error gracefully.

I don't know how many other cases there are in which Jhove returns status unknown.

paul-aloisio commented 1 year ago

And the same problem with Jhove was reported in 2015:| https://github.com/openpreserve/jhove/issues/16

paul-aloisio commented 1 year ago

Being reviewed by carlwilson in JHOVE issue:

https://github.com/openpreserve/jhove/issues/808#issuecomment-1372316795