Jpylyzer Review Demonstration
Created: 2012-03-15 00:20:38
Last updated: 2012-03-15 00:22:37
Review demonstration workflow that compares the jpylyzer tool with the struct checker and jhove. Runs on British Library JISC 1 content, looking for invalid images.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (0)
Titles (0)
Descriptions (0)
Dependencies (1)
pc-cc-jpylyzer-wrapper-0.0.1-SNAPSHOT.jar |
Inputs (1)
Name |
Description |
jiscIssueContainerList |
The String path to a JP2K file
|
Processors (2)
Name |
Type |
Description |
Jpylyzer |
beanshell |
Scriptimport eu.scape_project.pc.cc.ContainerUnpacker;
import eu.scape_project.pc.cc.JpylyzerWrapper;
import eu.scape_project.pc.cc.Jp2StructCheckWrapper;
JpylyzerWrapper jpylyzer = JpylyzerWrapper.getInstance();
Jp2StructCheckWrapper structChecker = Jp2StructCheckWrapper.getInstance();
List validImages = new ArrayList();
List invalidImages = new ArrayList();
String json = "var json = {\n";
json+="\t'color': ['#228800', '#ff0000'],\n";
json+="\t'label': ['valid images', 'invalid images'],\n";
json+="\t'values': [\n";
json+="\t{\n\t\t'label': 'jhove 1.6',\n\t\t'values': [48, 0]\n\t},\n";
for (String zipPath : zipPaths) {
ContainerUnpacker unpacker = ContainerUnpacker.getInstance(zipPath);
for (String entryName : unpacker.getEntryNames()) {
String id = zipPath + "#" + entryName;
File jp2kFile = unpacker.getUnzippedFile(entryName);
jpylyzer.validateJp2kFile(jp2kFile);
if (jpylyzer.isValid()) {
validImages.add(id + "\n" + jpylyzer.toString());
} else {
invalidImages.add(id + "\n" + jpylyzer.toString());
}
structChecker.structCheckJp2kFile(jp2kFile);
}
unpacker.cleanup();
}
List validJp2ks = validImages;
List invalidJp2ks = invalidImages;
String summary = "Issues Processed: " + ContainerUnpacker.getContainerCount();
summary += "\n" + "Images Analysed: " + (JpylyzerWrapper.getValidCount() + JpylyzerWrapper.getInvalidCount());
summary += "\n" + JpylyzerWrapper.getValidCount() + " images were valid JP2Ks.";
summary += "\n" + JpylyzerWrapper.getInvalidCount() + " images were invalid.";
json+="\t{\n\t\t'label': 'jp2StructCheck',\n\t\t'values': [" + structChecker.getValidCount() + "," + structChecker.getInvalidCount() + "]\n\t},\n";
json+="\t{\n\t\t'label': 'jpylyzer',\n\t\t'values': [" + JpylyzerWrapper.getValidCount() + ", " + JpylyzerWrapper.getInvalidCount() + "]\n\t}]\n\n";
json+="};";
|
ManifestParser |
beanshell |
ScriptList zipPaths = new ArrayList();
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(new File(issueManifestPath))));
String nextLine;
while ((nextLine = reader.readLine()) != null) {
zipPaths.add(nextLine);
}
List jiscIssueContainers = zipPaths; |
Beanshells (2)
Name |
Description |
Inputs |
Outputs |
Jpylyzer |
|
zipPaths
|
validJp2ks
invalidJp2ks
summary
json
|
ManifestParser |
|
issueManifestPath
|
jiscIssueContainers
|
Outputs (4)
Name |
Description |
validJp2ks |
|
invalidJp2ks |
|
summary |
|
json |
|
Datalinks (6)
Source |
Sink |
ManifestParser:jiscIssueContainers |
Jpylyzer:zipPaths |
jiscIssueContainerList |
ManifestParser:issueManifestPath |
Jpylyzer:validJp2ks |
validJp2ks |
Jpylyzer:invalidJp2ks |
invalidJp2ks |
Jpylyzer:summary |
summary |
Jpylyzer:json |
json |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (0)
None
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment