Skip to content

Commit 0731c63

Browse files
committed
REL: JHOVE v1.34.0-RC1
- changed trailer size handling so that -1 always means failed to find a trailer size definition, rather than 0 which is a misleading default; - added offset reporting to new PDF messages; - refactored some PDF String constants in text stream handling to make code clearer; - added missing untranslated messages to translation files: - to avoid issues with missing messages; - to ensure that all messages are available for translation; - bumped XML Handler version to v1.14 for changes to XML processing for schema fixes; - bumped main JHOVE version to v1.34.0-RC1; - refreshed release dates to today's date; - small improvements to logging for main test scripts; and - tweaked test script for 1.34.
1 parent d4b4c8e commit 0731c63

File tree

57 files changed

+334
-63
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+334
-63
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# See https://docs.docker.com/engine/userguide/eng-image/multistage-build/
22
# First build the app on a maven open jdk 11 container
3-
ARG JHOVE_VERSION=1.33.0-SNAPSHOT
3+
ARG JHOVE_VERSION=1.34.0-RC1
44
FROM maven:3-eclipse-temurin-11-alpine AS dev-builder
55
ARG JHOVE_VERSION
66
ENV JHOVE_VERSION=${JHOVE_VERSION}

Dockerfile_dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# See https://docs.docker.com/engine/userguide/eng-image/multistage-build/
22
# First build the app on a maven open jdk 11 container
3-
ARG JHOVE_VERSION=1.33.0-SNAPSHOT
3+
ARG JHOVE_VERSION=1.34.0-RC1
44
FROM maven:3-eclipse-temurin-11-alpine AS dev-builder
55
ARG JHOVE_VERSION
66
ENV JHOVE_VERSION=${JHOVE_VERSION}

jhove-apps/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<parent>
66
<groupId>org.openpreservation.jhove</groupId>
77
<artifactId>jhove</artifactId>
8-
<version>1.33.0-SNAPSHOT</version>
8+
<version>1.34.0-RC1</version>
99
</parent>
1010

1111
<artifactId>jhove-apps</artifactId>
1212
<packaging>jar</packaging>
13-
<version>1.33.0-SNAPSHOT</version>
13+
<version>1.34.0-RC1</version>
1414

1515

1616
<name>JHOVE Applications</name>
@@ -60,7 +60,7 @@
6060
<dependency>
6161
<groupId>org.openpreservation.jhove</groupId>
6262
<artifactId>jhove-core</artifactId>
63-
<version>1.33.0-SNAPSHOT</version>
63+
<version>1.34.0-RC1</version>
6464
</dependency>
6565
</dependencies>
6666

jhove-bbt/scripts/create-1.33-target.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,9 @@ do
134134
cp "${candidateRoot}/${filename}" "${targetRoot}/${filename}"
135135
fi
136136
done
137+
138+
if [[ -d "${targetRoot}/regression/modules/PDF-hul" ]]; then
139+
echo " - removing existing regressions for PDF ${targetRoot}/regression/modules/PDF-hul."
140+
rm -rf "${targetRoot}/regression/modules/PDF-hul"
141+
cp -r "${candidateRoot}/regression/modules/PDF-hul" "${targetRoot}/regression/modules/PDF-hul"
142+
fi
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
#!/usr/bin/env bash
2+
3+
testRoot="test-root"
4+
paramCandidateVersion=""
5+
paramBaselineVersion=""
6+
baselineRoot="${testRoot}/baselines"
7+
candidateRoot="${testRoot}/candidates"
8+
targetRoot="${testRoot}/targets"
9+
# Check the passed params to avoid disapointment
10+
checkParams () {
11+
OPTIND=1 # Reset in case getopts previously used
12+
13+
while getopts "h?b:c:" opt; do # Grab the options
14+
case "$opt" in
15+
h|\?)
16+
showHelp
17+
exit 0
18+
;;
19+
b) paramBaselineVersion=$OPTARG
20+
;;
21+
c) paramCandidateVersion=$OPTARG
22+
;;
23+
esac
24+
done
25+
26+
if [ -z "$paramBaselineVersion" ] || [ -z "$paramCandidateVersion" ]
27+
then
28+
showHelp
29+
exit 0
30+
fi
31+
32+
baselineRoot="${baselineRoot}/${paramBaselineVersion}"
33+
candidateRoot="${candidateRoot}/${paramCandidateVersion}"
34+
targetRoot="${targetRoot}/${paramCandidateVersion}"
35+
}
36+
37+
# Show usage message
38+
showHelp() {
39+
echo "usage: create-target [-b <baselineVersion>] [-c <candidateVersion>] [-h|?]"
40+
echo ""
41+
echo " baselineVersion : The version number id for the baseline data."
42+
echo " candidateVersion : The version number id for the candidate data."
43+
echo ""
44+
echo " -h|? : This message."
45+
}
46+
47+
# Execution starts here
48+
checkParams "$@";
49+
if [[ -d "${targetRoot}" ]]; then
50+
echo " - removing existing baseline at ${targetRoot}."
51+
rm -rf "${targetRoot}"
52+
fi
53+
54+
echo "TEST BASELINE: Creating baseline"
55+
# Simply copy baseline for now we're not making any changes
56+
echo " - copying ${baselineRoot} baseline to ${targetRoot}"
57+
cp -R "${baselineRoot}" "${targetRoot}"
58+
59+
# Patch release details of the XML reporting module in the audit file
60+
find "${targetRoot}" -type f -name "audit.jhove.xml" -exec sed -i 's/outputHandler release="1.13">XML/outputHandler release="1.14">XML/' {} \;
61+
62+
# Update release details for HTML module
63+
find "${targetRoot}" -type f -name "*.html.jhove.xml" -exec sed -i 's/<reportingModule release="1.4.4" date="2024-08-22">HTML-hul<\/reportingModule>/<reportingModule release="1.4.5" date="2025-03-12">HTML-hul<\/reportingModule>/' {} \;
64+
find "${targetRoot}" -type f -name "audit.jhove.xml" -exec sed -i 's/<module release="1.4.4">HTML-hul<\/module>/<module release="1.4.5">HTML-hul<\/module>/' {} \;
65+
find "${targetRoot}" -type f -name "audit-HTML-hul.jhove.xml" -exec sed -i 's/<release>1.4.4<\/release>/<release>1.4.5<\/release>/' {} \;
66+
find "${targetRoot}" -type f -name "audit-HTML-hul.jhove.xml" -exec sed -i 's/2024-08-22/2025-03-12/' {} \;
67+
find "${targetRoot}" -type f -name "audit-HTML-hul.jhove.xml" -exec sed -i 's/01-08-2002/2002-08-01/' {} \;
68+
find "${targetRoot}" -type f -name "audit-HTML-hul.jhove.xml" -exec sed -i 's/31-05-2001/2001-05-31/' {} \;
69+
70+
# Update release details for JPEG 2000 module
71+
find "${targetRoot}" -type f -name "*.jp2.jhove.xml" -exec sed -i 's/<reportingModule release="1.4.4" date="2023-03-16">JPEG2000-hul<\/reportingModule>/<reportingModule release="1.4.5" date="2025-03-12">JPEG2000-hul<\/reportingModule>/' {} \;
72+
find "${targetRoot}" -type f -name "*.jpx.jhove.xml" -exec sed -i 's/<reportingModule release="1.4.4" date="2023-03-16">JPEG2000-hul<\/reportingModule>/<reportingModule release="1.4.5" date="2025-03-12">JPEG2000-hul<\/reportingModule>/' {} \;
73+
find "${targetRoot}" -type f -name "*.md.jhove.xml" -exec sed -i 's/<reportingModule release="1.4.4" date="2023-03-16">JPEG2000-hul<\/reportingModule>/<reportingModule release="1.4.5" date="2025-03-12">JPEG2000-hul<\/reportingModule>/' {} \;
74+
find "${targetRoot}" -type f -name "audit.jhove.xml" -exec sed -i 's/<module release="1.4.4">JPEG2000-hul<\/module>/<module release="1.4.5">JPEG2000-hul<\/module>/' {} \;
75+
find "${targetRoot}" -type f -name "audit-JPEG2000-hul.jhove.xml" -exec sed -i 's/<release>1.4.4<\/release>/<release>1.4.5<\/release>/' {} \;
76+
find "${targetRoot}" -type f -name "audit-JPEG2000-hul.jhove.xml" -exec sed -i 's/2023-03-16/2025-03-12/' {} \;
77+
78+
# Copy the files affected by the relative URL output changes to the XML reporting module
79+
if [[ -f "${candidateRoot}/errors/modules/JPEG2000-hul/ランダム日本語テキスト.jp2.jhove.xml" ]]; then
80+
cp "${candidateRoot}/errors/modules/JPEG2000-hul/ランダム日本語テキスト.jp2.jhove.xml" "${targetRoot}/errors/modules/JPEG2000-hul/ランダム日本語テキスト.jp2.jhove.xml"
81+
fi
82+
if [[ -f "${candidateRoot}/errors/modules/JPEG2000-hul/隨機中國文字.jp2.jhove.xml" ]]; then
83+
cp "${candidateRoot}/errors/modules/JPEG2000-hul/隨機中國文字.jp2.jhove.xml" "${targetRoot}/errors/modules/JPEG2000-hul/隨機中國文字.jp2.jhove.xml"
84+
fi
85+
86+
# Copy the files affected by the change to the JPEG-2000 module that prevents empty CompositeListHeader lists from been created
87+
if [[ -f "${candidateRoot}/errors/modules/JPEG2000-hul/is_jpx.jp2.jhove.xml" ]]; then
88+
cp "${candidateRoot}/errors/modules/JPEG2000-hul/is_jpx.jp2.jhove.xml" "${targetRoot}/errors/modules/JPEG2000-hul/is_jpx.jp2.jhove.xml"
89+
fi
90+
if [[ -f "${candidateRoot}/examples/modules/JPEG2000-hul/ROITest.jpx.jhove.xml" ]]; then
91+
cp "${candidateRoot}/examples/modules/JPEG2000-hul/ROITest.jpx.jhove.xml" "${targetRoot}/examples/modules/JPEG2000-hul/ROITest.jpx.jhove.xml"
92+
fi
93+
94+
# Update release details for PDF module
95+
find "${targetRoot}" -type f -name "*.pdf.jhove.xml" -exec sed -i 's/<reportingModule release="1.12.7" date="2024-08-22">PDF-hul<\/reportingModule>/<reportingModule release="1.12.8" date="2025-03-12">PDF-hul<\/reportingModule>/' {} \;
96+
find "${targetRoot}" -type f -name "audit.jhove.xml" -exec sed -i 's/<module release="1.12.7">PDF-hul<\/module>/<module release="1.12.8">PDF-hul<\/module>/' {} \;
97+
find "${targetRoot}" -type f -name "audit-PDF-hul.jhove.xml" -exec sed -i 's/<release>1.12.7<\/release>/<release>1.12.8<\/release>/' {} \;
98+
find "${targetRoot}" -type f -name "audit-PDF-hul.jhove.xml" -exec sed -i 's/2024-08-22/2025-03-12/' {} \;
99+
100+
# Fix the results affected by the improvements to date handling in the PDF module
101+
sed -i 's/<message offset/<message subMessage="For date property: CreationDate, value: Tue Feb 03 16:19:57 2004" offset/' "${targetRoot}/examples/modules/PDF-hul/AA_Banner.pdf.jhove.xml"
102+
if [[ -f "${candidateRoot}/errors/modules/PDF-hul/pdf-hul-9-govdocs-065694.pdf.jhove.xml" ]]; then
103+
cp "${candidateRoot}/errors/modules/PDF-hul/pdf-hul-9-govdocs-065694.pdf.jhove.xml" "${targetRoot}/errors/modules/PDF-hul/pdf-hul-9-govdocs-065694.pdf.jhove.xml"
104+
fi
105+
106+
# Insert new PDF-2.x signature nodes into the PDF audit XML files
107+
find "${targetRoot}" -type f -name "audit-PDF-hul.jhove.xml" -exec sed -i 's/<\/signatures>/ <signature>\n <type>Magic number<\/type>\n <value>%PDF-2.<\/value>\n <offset>0x0<\/offset>\n <use>Mandatory<\/use>\n <\/signature>\n <\/signatures>/' {} \;
108+
109+
# Copy the two new version regression test files, where handling of PDF version declaration has been improved/changed
110+
declare -a pdf_version_affected=("errors/modules/PDF-hul/pdf-hul-61-CERN-2005-009.pdf.jhove.xml"
111+
"regression/modules/PDF-hul/PDF-HUL-137.pdf.jhove.xml"
112+
"regression/modules/PDF-hul/PDF-HUL-137_fixed.pdf.jhove.xml")
113+
for filename in "${pdf_version_affected[@]}"
114+
do
115+
if [[ -f "${candidateRoot}/${filename}" ]]; then
116+
cp "${candidateRoot}/${filename}" "${targetRoot}/${filename}"
117+
fi
118+
done
119+
120+
# Copy the results of the test files fixed by the addition of basic text stream validation
121+
declare -a pdf_version_affected=("errors/modules/PDF-hul/T02-05-01_009_Missing_open_paranthesis.pdf.jhove.xml"
122+
"errors/modules/PDF-hul/T02-05-01_010_Missing_closing_paranthesis.pdf.jhove.xml"
123+
"errors/modules/PDF-hul/T02-05-01_011_paranthesis-substituted-with-brackets.pdf.jhove.xml")
124+
for filename in "${pdf_version_affected[@]}"
125+
do
126+
if [[ -f "${candidateRoot}/${filename}" ]]; then
127+
cp "${candidateRoot}/${filename}" "${targetRoot}/${filename}"
128+
fi
129+
done
130+
131+
# Copy the regression test files affected by the change to object count checking against size
132+
declare -a xref_size_affected=("errors/modules/PDF-hul/pdf-hul-73-bug-size-int.pdf.jhove.xml"
133+
"regression/modules/PDF-hul/issue_531.pdf.jhove.xml")
134+
for filename in "${xref_size_affected[@]}"
135+
do
136+
if [[ -f "${candidateRoot}/${filename}" ]]; then
137+
cp "${candidateRoot}/${filename}" "${targetRoot}/${filename}"
138+
fi
139+
done
140+
141+
if [[ -d "${targetRoot}/regression/modules/PDF-hul" ]]; then
142+
echo " - removing existing regressions for PDF ${targetRoot}/regression/modules/PDF-hul."
143+
rm -rf "${targetRoot}/regression/modules/PDF-hul"
144+
cp -r "${candidateRoot}/regression/modules/PDF-hul" "${targetRoot}/regression/modules/PDF-hul"
145+
fi

jhove-bbt/scripts/process-modules.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ processModuleDir() {
110110
while IFS= read -r -d '' FILE; do
111111
fileName=$( basename "$FILE" )
112112
if [[ ! $fileName == ".gitignore" ]] && [[ ! $fileName == "README" ]]; then
113-
echo "Testing ${FILE}"
113+
echo "Testing ${FILE} with ${paramJhoveLoc}/jhove"
114114
bash "$SCRIPT_DIR/exec-with-to.sh" -t 30 "$paramJhoveLoc/jhove" -m "${moduleName}" -h xml -o "$paramOutputRootDir/$moduleName/$fileName.jhove.xml" -k "$FILE"
115115
fi
116116
done < <(find "$moduleDir" -type f -print0)

jhove-bbt/scripts/travis-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ BASELINE_VERSION=1.32
2626
echo "INFO: Checking for baseline installation for release version ${BASELINE_VERSION}."
2727
if [[ ! -d "${TEST_INSTALL_ROOT}/${BASELINE_VERSION}" ]]; then
2828
echo " - INFO: installing baseline version ${BASELINE_VERSION} to: ${TEST_INSTALL_ROOT}/${BASELINE_VERSION}."
29-
installJhoveFromURL "http://software.openpreservation.org/rel/jhove/${BASELINE_VERSION}/jhove-xplt-installer-${BASELINE_VERSION}.1-RC1.jar" "${TEST_INSTALL_ROOT}" "${BASELINE_VERSION}"
29+
installJhoveFromURL "http://software.openpreservation.org/rel/jhove/jhove-${BASELINE_VERSION}.jar" "${TEST_INSTALL_ROOT}" "${BASELINE_VERSION}"
3030
else
3131
echo " - INFO: using baseline version ${BASELINE_VERSION} at: ${TEST_INSTALL_ROOT}/${BASELINE_VERSION}."
3232
fi
@@ -56,7 +56,7 @@ fi
5656
# Grab the Major and Minor versions from the full Maven project version string
5757
# FIXME: Colorised output is not working with the following line
5858
# MVN_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec -f jhove-installer/pom.xml)
59-
MVN_VERSION="1.33.0-SNAPSHOT"
59+
MVN_VERSION="1.34.0-RC1"
6060
MAJOR_MINOR_VER="${MVN_VERSION%.*}"
6161
JHOVE_INSTALLER="./jhove-installer/target/jhove-xplt-installer-${MVN_VERSION}.jar"
6262

jhove-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.openpreservation.jhove</groupId>
77
<artifactId>jhove</artifactId>
8-
<version>1.33.0-SNAPSHOT</version>
8+
<version>1.34.0-RC1</version>
99
</parent>
1010

1111
<artifactId>jhove-core</artifactId>

jhove-core/src/main/java/edu/harvard/hul/ois/jhove/handler/XmlHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ protected NumberFormat initialValue() {
8787
private static final String NAME = "XML";
8888

8989
/** Handler release identifier. */
90-
private static final String RELEASE = "1.13";
90+
private static final String RELEASE = "1.14";
9191

9292
/** Handler release date. */
93-
private static final int[] DATE = { 2024, 11, 19 };
93+
private static final int[] DATE = { 2025, 03, 12 };
9494

9595
/** Handler informative note. */
9696
private static final String NOTE = "This output handler is defined by the XML Schema "

jhove-core/src/main/resources/edu/harvard/hul/ois/jhove/ErrorMessages.properties

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,25 @@ JHOVE-CORE-2 = File cannot be read
33
JHOVE-CORE-3 = Zero-length file
44
JHOVE-CORE-4 = Unsupported character encoding: {0}.
55
JHOVE-CORE-5 = Validation ended prematurely due to an unhandled exception.
6+
7+
EXC_CONF_FILE_LOC_MISS = Initialisation exception; location not specified for configuration file.
8+
EXC_CONF_FILE_INVAL = Use -c to specify a configuration file. Path not found or not readable:
9+
EXC_CONF_FILE_UNRDBL = Cannot read configuration file:
10+
EXC_CONF_FILE_UNPRS = Error parsing configuration file:
11+
EXC_FILE_OPEN = Cannot open output file:
12+
EXC_HNDL_INST_FAIL = Cannot instantiate handler:
13+
EXC_JAVA_VER_INCMPT = Java 1.8 or higher is required
14+
EXC_MODL_INST_FAIL = Cannot instantiate module:
15+
EXC_PRV_CNSTRCT = Entered private constructor for:
16+
EXC_PROP_VAL_NULL = Null value not permitted for property:
17+
EXC_SAX_PRSR_MISS = SAX parser not found:
18+
EXC_PROP_CLSS_INCMPT = Incompatible class for property:
19+
EXC_SCL_PROP_CLSS_INCMPT = {0} Scalar.
20+
EXC_MAP_PROP_CLSS_INCMPT = {0} Map.
21+
EXC_SET_PROP_CLSS_INCMPT = {0} Set.
22+
EXC_LIST_PROP_CLSS_INCMPT = {0} List.
23+
EXC_TEMP_FILE_CRT = Cannot create temporary file
24+
EXC_URI_CONV_FAIL = Cannot convert URI to URL:
25+
EXC_URL_NOT_FND = URL not found:
26+
ERR_APP_PROP_MISS = No application properties found for:
27+
ERR_ICC_PRFL_DESC_MISS = No description in ICC profile v4

0 commit comments

Comments
 (0)