openpreserve / jhove

File validation and characterisation.
http://jhove.openpreservation.org
Other
171 stars 79 forks source link

ModDate in Document Information Dictionary not checked for correct date form #671

Open asciim0 opened 3 years ago

asciim0 commented 3 years ago

This issue is partially related to #670 It seems that within the Document Information Dictionary /CreationDate is checked for correct date notation while ModDate is not. The file with the following Information Dictionary checks out as valid:

711 0 obj 
<<
/Creator (QuarkXPress\(R\) 8.1)
/Title <feff004c00610079006f0075007400200031>
/Producer (QuarkXPress\(R\) 8.1)
/XPressPrivate (%%DocumentProcessColors: Cyan Magenta Yellow Black\n%%EndComments)
/ModDate (20190709173525+01'00')
/CreationDate (D:20190709173525+01'00')
>>

When the CreationDate is formatted incorrectly (missing "D:" prefix) the file is reported as described in #670 . However, the /ModDate has the same incorrect formatting and it doesn't seem to matter.

IMO incorrectly formatted /ModDate should throw an error (well-formed but not valid).