Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifications in JPEG2000 module to output more info in mix formats #445

Merged
merged 8 commits into from
Oct 22, 2019
Merged
13 changes: 12 additions & 1 deletion jhove-bbt/scripts/create-1.23-target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,16 @@ if [[ -d "${targetRoot}" ]]; then
fi

echo "Executing baseline update"
# Simply copy baseline for now we're not making any changes
# Copying baseline for now we're not making any changes
cp -R "${baselineRoot}" "${targetRoot}"

# # Copy valid JP2K files across for new MIX metadata see https://github.com/openpreserve/jhove/pull/445
if [[ -d "${candidateRoot}/examples/modules/JPEG2000-hul" ]]; then
echo "Copying valid JPEG2000 examples."
cp -Rf "${candidateRoot}/examples/modules/JPEG2000-hul" "${targetRoot}/examples/modules/"
cp -Rf "${candidateRoot}/errors/modules/JPEG2000-hul" "${targetRoot}/errors/modules/"
fi
find "${targetRoot}" -type f -name "audit.jhove.xml" -exec sed -i 's/^ <module release="1.4.1">JPEG2000-hul<\/module>$/ <module release="1.4.2">JPEG2000-hul<\/module>/' {} \;
find "${targetRoot}" -type f -name "audit.jhove.xml" -exec sed -i 's/^ <outputHandler release="1.8">XML/ <outputHandler release="1.9">XML/' {} \;
find "${targetRoot}" -type f -name "audit-JPEG2000-hul.jhove.xml" -exec sed -i 's/^ <release>1.4.1<\/release>$/ <release>1.4.2<\/release>/' {} \;
find "${targetRoot}" -type f -name "audit-JPEG2000-hul.jhove.xml" -exec sed -i 's/^ <date>2019-04-17<\/date>$/ <date>2019-10-18<\/date>/' {} \;
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class NisoImageMetadata
};

/** 6.1.3.1 Compression scheme value labels. */
/* Taken from the TIFFTAG_COMPRESSION */
public static final String [] COMPRESSION_SCHEME = {
"uncompressed", "CCITT 1D", "CCITT Group 3", "CCITT Group 4", /* 1-4 */
"LZW", "JPEG", "ISO JPEG", "Deflate", /* 5-8 */
Expand All @@ -81,9 +82,14 @@ public class NisoImageMetadata
"Kodak DCS", /* 32947 */
"SGI 32-bit Log Luminance encoding", /* 34676 */
"SGI 24-bit Log Luminance encoding", /* 34677 */
"JPEG 2000" /* 34712 */
"JPEG 2000", /* 34712 */
"JPEG2000 Lossy", /* 34713 non standard !!! */
"JPEG2000 Lossless", /* 34714 non standard !!! */
"LZMA" /* 34925 */
};
/** Index for 6.1.3.1 compression scheme value labels. */
public static final int COMPRESSION_JPEG2000_LOSSY = 34713;
public static final int COMPRESSION_JPEG2000_LOSSLESS = 34714;
public static final int [] COMPRESSION_SCHEME_INDEX = {
1, 2, 3, 4,
5, 6, 7, 8,
Expand All @@ -98,7 +104,10 @@ public class NisoImageMetadata
32947,
34676,
34677,
34712
34712,
34713, /* non standard !!! */
34714, /* non standard !!! */
34925
};

/** 6.2.5 display orientation value labels. */
Expand Down Expand Up @@ -309,6 +318,19 @@ public class NisoImageMetadata
/** 6.3 Preferred presentation */
private String _preferredPresentation;

/******************************************************************
* Special Format Characteristics
* From Data Dictionary - Technical Metadata for Digital Still Images
* (ANSI/NISO Z39.87-2006)
* Only used for JPEG2000 format
******************************************************************/
/** 7.2.1.2.1 tiles */
private String _jp2Tiles;
/** 7.2.1.2.2 qualityLayers */
private int _jp2Layers;
/** 7.2.1.2.3resolutionLevels */
private int _jp2ResolutionLevels;

/******************************************************************
* 7 Image creation
******************************************************************/
Expand Down Expand Up @@ -551,6 +573,9 @@ public NisoImageMetadata ()
_imageData = null;
_imageLength = NULL;
_imageWidth = NULL;
_jp2Layers = NULL;
_jp2ResolutionLevels = NULL;
_jp2Tiles = null;
_maxApertureValue = null;
_meteringMode = NULL;
_orientation = NULL;
Expand Down Expand Up @@ -932,7 +957,31 @@ public String getPreferredPresentation ()
return _preferredPresentation;
}

/** Get 8.2.8.5 primary chromaticities blue X. */
public String getJp2Tiles() {
return _jp2Tiles;
}

public void setJp2Tiles(String jp2Tiles) {
this._jp2Tiles = jp2Tiles;
}

public int getJp2Layers() {
return _jp2Layers;
}

public void setJp2Layers(int jp2Layers) {
this._jp2Layers = jp2Layers;
}

public int getJp2ResolutionLevels() {
return _jp2ResolutionLevels;
}

public void setJp2ResolutionLevels(int jp2ResolutionLevels) {
this._jp2ResolutionLevels = jp2ResolutionLevels;
}

/** Get 8.2.8.5 primary chromaticities blue X. */
public Rational getPrimaryChromaticitiesBlueX ()
{
return _primaryChromaticitiesBlueX;
Expand Down
Loading