Skip to content

Commit

Permalink
Merge pull request #153 from daveneiman/assorted_release_fixes
Browse files Browse the repository at this point in the history
Tweak DROID and NLNZ ME transformations.
  • Loading branch information
daveneiman authored Aug 9, 2017
2 parents e7bba55 + 534a7cc commit d20abbf
Show file tree
Hide file tree
Showing 19 changed files with 2,540 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,6 @@
<classpathentry kind="lib" path="lib/droid/jwat-warc-1.0.2.jar"/>
<classpathentry kind="lib" path="lib/droid/poi-3.13.jar"/>
<classpathentry kind="lib" path="lib/droid/trove4j-3.0.3.jar"/>
<classpathentry kind="lib" path="lib/ots-1.0.46.jar"/>
<classpathentry kind="lib" path="lib/ots-1.0.49.jar"/>
<classpathentry kind="output" path="build"/>
</classpath>
Binary file removed lib/ots-1.0.46.jar
Binary file not shown.
Binary file added lib/ots-1.0.49.jar
Binary file not shown.
2,335 changes: 2,335 additions & 0 deletions testfiles/MMS-82A.08.12.02.ai

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions testfiles/output/MMS-82A.08.12.02.ai_XmlUnitExpectedOutput.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<fits xmlns="http://hul.harvard.edu/ois/xml/ns/fits/fits_output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/fits/fits_output http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd" version="1.2.0" timestamp="8/9/17 3:16 PM">
<identification>
<identity format="Adobe Illustrator" mimetype="application/postscript" toolname="FITS" toolversion="1.2.0">
<tool toolname="Droid" toolversion="6.3" />
<tool toolname="Exiftool" toolversion="10.00" />
<version toolname="Droid" toolversion="6.3">9.0</version>
<externalIdentifier toolname="Droid" toolversion="6.3" type="puid">fmt/558</externalIdentifier>
</identity>
</identification>
<fileinfo>
<size toolname="Jhove" toolversion="1.16">561633</size>
<creatingApplicationName toolname="Jhove" toolversion="1.16">Adobe PDF library 4.800/Adobe Illustrator 9.0</creatingApplicationName>
<created toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">2002:08:10 18:43:47</created>
<filepath toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">/Users/dan179/git/git-daveneiman/fits/testfiles/MMS-82A.08.12.02.ai</filepath>
<filename toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">MMS-82A.08.12.02.ai</filename>
<md5checksum toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">b09e1524642c0166da3566d4c7e03871</md5checksum>
<fslastmodified toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">1502306011000</fslastmodified>
</fileinfo>
<filestatus />
<metadata>
<image>
<imageWidth toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">315</imageWidth>
<imageHeight toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">704</imageHeight>
</image>
</metadata>
<statistics fitsExecutionTime="1716">
<tool toolname="MediaInfo" toolversion="0.7.75" status="did not run" />
<tool toolname="OIS Audio Information" toolversion="0.1" status="did not run" />
<tool toolname="ADL Tool" toolversion="0.1" status="did not run" />
<tool toolname="VTT Tool" toolversion="0.1" status="did not run" />
<tool toolname="Droid" toolversion="6.3" executionTime="146" />
<tool toolname="Jhove" toolversion="1.16" executionTime="665" />
<tool toolname="file utility" toolversion="5.04" executionTime="557" />
<tool toolname="Exiftool" toolversion="10.00" executionTime="624" />
<tool toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="did not run" />
<tool toolname="OIS File Information" toolversion="0.2" executionTime="141" />
<tool toolname="OIS XML Metadata" toolversion="0.2" status="did not run" />
<tool toolname="ffident" toolversion="0.2" executionTime="487" />
<tool toolname="Tika" toolversion="1.10" executionTime="1664" />
</statistics>
</fits>

2 changes: 1 addition & 1 deletion testfiles/properties/fits-full-with-tool-output.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.AudioInfo" include-exts="wav" classpath-dirs="lib/audioinfo" />
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.ADLTool" include-exts="adl" classpath-dirs="lib/adltool" />
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.VTTTool" include-exts="vtt" />
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm" classpath-dirs="lib/droid" />
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm,m4a" classpath-dirs="lib/droid" />
<tool class="edu.harvard.hul.ois.fits.tools.jhove.Jhove" exclude-exts="dng,mbx,mbox,arw,adl,eml,java,doc,docx,docm,odt,rtf,pages,wpd,wp,epub,csv,avi,mov,mpg,mpeg,mkv,mp4,mpeg4,m2ts,mxf,ogv,mj2,divx,dv,m4v,m2v,ismv,pcd,zip" classpath-dirs="lib/jhove" />
<tool class="edu.harvard.hul.ois.fits.tools.fileutility.FileUtility" exclude-exts="dng,wps,adl,jar,epub,csv" classpath-dirs="lib/fileutility" />
<tool class="edu.harvard.hul.ois.fits.tools.exiftool.Exiftool" exclude-exts="txt,wps,vsd,jar,avi,mov,mpg,mpeg,mkv,mp4,mxf,ogv,mj2,divx,dv,m4v,m2v,ismv,m2ts,mpeg4" classpath-dirs="lib/exiftool" />
Expand Down
2 changes: 1 addition & 1 deletion testfiles/properties/fits_droid_only.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.AudioInfo" include-exts="wav" classpath-dirs="lib/audioinfo" />
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.ADLTool" include-exts="adl" classpath-dirs="lib/adltool" />
-->
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm" classpath-dirs="lib/droid" />
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm,m4a" classpath-dirs="lib/droid" />
<!--
<tool class="edu.harvard.hul.ois.fits.tools.jhove.Jhove" exclude-exts="dng,mbx,mbox,arw,adl,eml,java,doc,docx,odt,rtf,pages,wpd,wp,epub" classpath-dirs="lib/jhove" />
<tool class="edu.harvard.hul.ois.fits.tools.fileutility.FileUtility" exclude-exts="dng,wps,adl,jar,epub" classpath-dirs="lib/fileutility" />
Expand Down
2 changes: 1 addition & 1 deletion testfiles/properties/fits_droid_tika.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.AudioInfo" include-exts="wav" classpath-dirs="lib/audioinfo" />
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.ADLTool" include-exts="adl" classpath-dirs="lib/adltool" />
-->
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm" classpath-dirs="lib/droid" />
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm,m4a" classpath-dirs="lib/droid" />
<!--
<tool class="edu.harvard.hul.ois.fits.tools.jhove.Jhove" exclude-exts="dng,mbx,mbox,arw,adl,eml,java,doc,docx,odt,rtf,pages,wpd,wp,epub" classpath-dirs="lib/jhove" />
<tool class="edu.harvard.hul.ois.fits.tools.fileutility.FileUtility" exclude-exts="dng,wps,adl,jar,epub" classpath-dirs="lib/fileutility" />
Expand Down
2 changes: 1 addition & 1 deletion testfiles/properties/fits_no_md5_audio.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<tool class="edu.harvard.hul.ois.fits.tools.mediainfo.MediaInfo" include-exts="avi,mov,mpg,mpeg,mkv,mp4,mxf,ogv,mj2,divx,dv,m4v,m2v,ismv" classpath-dirs="lib/mediainfo" />
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.AudioInfo" include-exts="wav" classpath-dirs="lib/audioinfo" />
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.ADLTool" include-exts="adl" classpath-dirs="lib/adltool" />
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm" classpath-dirs="lib/droid" />
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm,m4a" classpath-dirs="lib/droid" />
<tool class="edu.harvard.hul.ois.fits.tools.jhove.Jhove" exclude-exts="dng,mbx,mbox,arw,adl,eml,java,doc,docx,docm,odt,rtf,pages,wpd,wp,epub,csv,avi,mov,mpg,mpeg,mkv,mp4,mpeg4,m2ts,mxf,ogv,mj2,divx,dv,m4v,m2v,ismv,pcd,zip" classpath-dirs="lib/jhove" />
<tool class="edu.harvard.hul.ois.fits.tools.fileutility.FileUtility" exclude-exts="dng,wps,adl,jar" classpath-dirs="lib/fileutility" />
<tool class="edu.harvard.hul.ois.fits.tools.exiftool.Exiftool" exclude-exts="txt,wps,vsd,jar,avi,mov,mpg,mpeg,mkv,mp4,mxf,ogv,mj2,divx,dv,m4v,m2v,ismv" classpath-dirs="lib/exiftool" />
Expand Down
2 changes: 1 addition & 1 deletion testfiles/properties/fits_no_md5_video.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<tool class="edu.harvard.hul.ois.fits.tools.mediainfo.MediaInfo" include-exts="avi,mov,mpg,mpeg,mkv,mp4,mxf,ogv,mj2,divx,dv,m4v,m2v,ismv" classpath-dirs="lib/mediainfo" />
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.AudioInfo" include-exts="wav" classpath-dirs="lib/audioinfo" />
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.ADLTool" include-exts="adl" classpath-dirs="lib/adltool" />
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm" classpath-dirs="lib/droid" />
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm,m4a" classpath-dirs="lib/droid" />
<tool class="edu.harvard.hul.ois.fits.tools.jhove.Jhove" exclude-exts="dng,mbx,mbox,arw,adl,eml,java,doc,docx,docm,odt,rtf,pages,wpd,wp,epub,csv,avi,mov,mpg,mpeg,mkv,mp4,mpeg4,m2ts,mxf,ogv,mj2,divx,dv,m4v,m2v,ismv,pcd,zip" classpath-dirs="lib/jhove" />
<tool class="edu.harvard.hul.ois.fits.tools.fileutility.FileUtility" exclude-exts="dng,wps,adl,jar" classpath-dirs="lib/fileutility" />
<tool class="edu.harvard.hul.ois.fits.tools.exiftool.Exiftool" exclude-exts="txt,wps,vsd,jar,avi,mov,mpg,mpeg,mkv,mp4,mxf,ogv,mj2,divx,dv,m4v,m2v,ismv" classpath-dirs="lib/exiftool" />
Expand Down
2 changes: 1 addition & 1 deletion testfiles/properties/fits_tika_droid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.ADLTool" include-exts="adl" classpath-dirs="lib/adltool" />
-->
<tool class="edu.harvard.hul.ois.fits.tools.tika.TikaTool" exclude-exts="jar" classpath-dirs="lib/tika"/>
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm" classpath-dirs="lib/droid" />
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm,m4a" classpath-dirs="lib/droid" />
<!--
<tool class="edu.harvard.hul.ois.fits.tools.jhove.Jhove" exclude-exts="dng,mbx,mbox,arw,adl,eml,java,doc,docx,odt,rtf,pages,wpd,wp,epub" classpath-dirs="lib/jhove" />
<tool class="edu.harvard.hul.ois.fits.tools.fileutility.FileUtility" exclude-exts="dng,wps,adl,jar,epub" classpath-dirs="lib/fileutility" />
Expand Down
67 changes: 67 additions & 0 deletions tests/edu/harvard/hul/ois/fits/junit/AdobeIllustratorXmlTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright 2016 Harvard University Library
*
* This file is part of FITS (File Information Tool Set).
*
* FITS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FITS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with FITS. If not, see <http://www.gnu.org/licenses/>.
*/
package edu.harvard.hul.ois.fits.junit;

import java.io.File;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import edu.harvard.hul.ois.fits.Fits;
import edu.harvard.hul.ois.fits.FitsOutput;
import edu.harvard.hul.ois.fits.tests.AbstractXmlUnitTest;

/**
* These generated FITS output with tool output on the given Adobe Illustrator files.
* These tests should be run with &lt;display-tool-output&gt;false&lt;/display-tool-output&gt; in fits.xml.
*
* @author dan179
*/
public class AdobeIllustratorXmlTest extends AbstractXmlUnitTest {

/*
* Only one Fits instance is needed to run all tests.
* This also speeds up the tests.
*/
private static Fits fits;

@BeforeClass
public static void beforeClass() throws Exception {
// Set up FITS for entire class.
File fitsConfigFile = new File("testfiles/properties/fits-full-with-tool-output.xml");
fits = new Fits(null, fitsConfigFile);
}

@AfterClass
public static void afterClass() {
fits = null;
}

@Test
public void testtestAdobeIllustratorFile() throws Exception {

String inputFilename = "MMS-82A.08.12.02.ai";
File input = new File("testfiles/" + inputFilename);
FitsOutput fitsOut = fits.examine(input);
fitsOut.addStandardCombinedFormat();
fitsOut.saveToDisk("test-generated-output/" + inputFilename + "_Output.xml");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* Copyright 2016 Harvard University Library
*
* This file is part of FITS (File Information Tool Set).
*
* FITS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FITS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with FITS. If not, see <http://www.gnu.org/licenses/>.
*/
package edu.harvard.hul.ois.fits.junit;

import java.io.File;
import java.util.Scanner;

import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import edu.harvard.hul.ois.fits.Fits;
import edu.harvard.hul.ois.fits.FitsOutput;
import edu.harvard.hul.ois.fits.tests.AbstractXmlUnitTest;

/**
* These tests compare actual FITS output with expected output on Adobe Illustrator files.
*
* @author dan179
*/
public class AdobeIllustratorXmlUnitTest extends AbstractXmlUnitTest {

/*
* Only one Fits instance is needed to run all tests.
* This also speeds up the tests.
*/
private static Fits fits;

@BeforeClass
public static void beforeClass() throws Exception {
// Set up FITS for entire class.
fits = new Fits();
}

@AfterClass
public static void afterClass() {
fits = null;
}

@Test
public void testAdobeIllustratorFile() throws Exception {

String inputFilename = "MMS-82A.08.12.02.ai";
File input = new File("testfiles/" + inputFilename);
FitsOutput fitsOut = fits.examine(input);
fitsOut.saveToDisk("test-generated-output/" + inputFilename + ACTUAL_OUTPUT_FILE_SUFFIX);

XMLOutputter serializer = new XMLOutputter(Format.getPrettyFormat());
String actualXmlStr = serializer.outputString(fitsOut.getFitsXml());

// Read in the expected XML file
Scanner scan = new Scanner(new File(
"testfiles/output/" + inputFilename + EXPECTED_OUTPUT_FILE_SUFFIX));
String expectedXmlStr = scan.
useDelimiter("\\Z").next();
scan.close();

testActualAgainstExpected(actualXmlStr, expectedXmlStr, inputFilename);
}

}
6 changes: 2 additions & 4 deletions tests/edu/harvard/hul/ois/fits/junit/MixTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ public class MixTest extends AbstractLoggingTest {
@BeforeClass
public static void beforeClass() throws Exception {
// Set up FITS for entire class.
fits = new Fits();
// Use this instead of above line to turn on tool output.
// File fitsConfigFile = new File("testfiles/properties/fits-full-with-tool-output.xml");
// fits = new Fits(null, fitsConfigFile);
File fitsConfigFile = new File("testfiles/properties/fits-full-with-tool-output.xml");
fits = new Fits(null, fitsConfigFile);
}

@AfterClass
Expand Down
2 changes: 1 addition & 1 deletion tests/edu/harvard/hul/ois/fits/junit/ZipXmlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import edu.harvard.hul.ois.fits.tests.AbstractXmlUnitTest;

/**
* These tests compare actual FITS output with expected output on ZIP files.
* These generated FITS output with tool output on the given files files.
* These tests should be run with &lt;display-tool-output&gt;false&lt;/display-tool-output&gt; in fits.xml.
*
* @author dan179
Expand Down
3 changes: 3 additions & 0 deletions xml/exiftool/exiftool_common_to_fits.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
<xsl:when test="$mime='application/photoshop'">
<xsl:value-of select="string('image/vnd.adobe.photoshop')"/>
</xsl:when>
<xsl:when test="$mime='application/vnd.adobe.illustrator'">
<xsl:value-of select="string('application/postscript')"/>
</xsl:when>
<xsl:when test="not($mime) or $mime='' or $mime='application/unknown'">
<xsl:value-of select="string('application/octet-stream')"/>
</xsl:when>
Expand Down
2 changes: 1 addition & 1 deletion xml/fits.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.AudioInfo" include-exts="wav" classpath-dirs="lib/audioinfo" />
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.ADLTool" include-exts="adl" classpath-dirs="lib/adltool" />
<tool class="edu.harvard.hul.ois.fits.tools.oisfileinfo.VTTTool" include-exts="vtt" />
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm" classpath-dirs="lib/droid" />
<tool class="edu.harvard.hul.ois.fits.tools.droid.Droid" exclude-exts="odm,m4a" classpath-dirs="lib/droid" />
<tool class="edu.harvard.hul.ois.fits.tools.jhove.Jhove" exclude-exts="dng,mbx,mbox,arw,adl,eml,java,doc,docx,docm,odt,rtf,pages,wpd,wp,epub,csv,avi,mov,mpg,mpeg,mkv,mp4,mpeg4,m2ts,mxf,ogv,mj2,divx,dv,m4v,m2v,ismv,pcd,zip" classpath-dirs="lib/jhove" />
<tool class="edu.harvard.hul.ois.fits.tools.fileutility.FileUtility" exclude-exts="dng,wps,adl,jar,epub,csv" classpath-dirs="lib/fileutility" />
<tool class="edu.harvard.hul.ois.fits.tools.exiftool.Exiftool" exclude-exts="txt,wps,vsd,jar,avi,mov,mpg,mpeg,mkv,mp4,mxf,ogv,mj2,divx,dv,m4v,m2v,ismv,m2ts,mpeg4" classpath-dirs="lib/exiftool" />
Expand Down
1 change: 1 addition & 0 deletions xml/fits_format_tree.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<branch format="PDF/X">
<branch format="PDF/A"/>
</branch>
<branch format="Adobe Illustrator"/>
</branch>
<branch format="Plain text">
<branch format="Extensible Markup Language">
Expand Down
2 changes: 1 addition & 1 deletion xml/nlnz/fits/nlnz_jpeg_to_fits.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<identity>
<xsl:attribute name="format">
<xsl:choose>
<xsl:when test="/JPG/EXIF">
<xsl:when test="/JPG/EXIF and not(string-length(/JPG/EXIF) = 0)">
<xsl:value-of select="'JPEG EXIF'"/>
</xsl:when>
<xsl:when test="/JPG/JFIF/IDENTIFIER='JFIF'">
Expand Down

0 comments on commit d20abbf

Please sign in to comment.