Skip to content

Commit

Permalink
TIKA-2579 and TIKA-2607: Upgrade PDFBox to 2.0.9 and include new jbi…
Browse files Browse the repository at this point in the history
…g2-imageio from org.apache.pdfbox
  • Loading branch information
tballison committed Mar 28, 2018
1 parent 682c38d commit ee9e4f4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
4 changes: 3 additions & 1 deletion CHANGES.txt
Expand Up @@ -4,7 +4,9 @@ Release 2.0.0 - ???
* Remove deprecated Metadata keys/properties (TIKA-1974).

Other changes

* Upgrade PDFBox to 2.0.9 and include new jbig2-imageio
from org.apache.pdfbox (TIKA-2579 and TIKA-2607).

* Support for TIFF images in PDF files (TIKA-2338)

* Detection of full encrypted 7z files (TIKA-2568)
Expand Down
16 changes: 5 additions & 11 deletions tika-parsers/pom.xml
Expand Up @@ -42,7 +42,7 @@
<tukaani.version>1.8</tukaani.version>
<mime4j.version>0.8.1</mime4j.version>
<vorbis.version>0.8</vorbis.version>
<pdfbox.version>2.0.8</pdfbox.version>
<pdfbox.version>2.0.9</pdfbox.version>
<jempbox.version>1.8.13</jempbox.version>
<netcdf-java.version>4.5.5</netcdf-java.version>
<sis.version>0.8</sis.version>
Expand Down Expand Up @@ -679,18 +679,12 @@
<artifactId>jackson-core</artifactId>
<version>2.9.4</version>
</dependency>

<!-- Java ImageIO plugin for JBIG2 support (often used in PDF)
This jbig2 dep is not distributed with Tika due to licensing
issue (GPLV3). That's why it is included here as "test".
https://github.com/levigo/jbig2-imageio
-->
<dependency>
<groupId>com.levigo.jbig2</groupId>
<artifactId>levigo-jbig2-imageio</artifactId>
<version>1.6.5</version>
<scope>test</scope>
<groupId>org.apache.pdfbox</groupId>
<artifactId>jbig2-imageio</artifactId>
<version>3.0.0</version>
</dependency>

<!-- jai-imageio-core is allowed since LEGAL-304 -->
<dependency>
<groupId>com.github.jai-imageio</groupId>
Expand Down
Expand Up @@ -66,12 +66,10 @@ public class ImageParser extends AbstractParser {
MediaType.image("png"),
MediaType.image("vnd.wap.wbmp"),
MediaType.image("x-icon"),
MediaType.image("x-xcf")));
try {
Class.forName("com.levigo.jbig2.JBIG2ImageReader");
TMP_SUPPORTED.add(MediaType.image("x-jbig2"));
} catch (ClassNotFoundException e) {
}
MediaType.image("x-xcf"),
MediaType.image("x-jbig2")));
//add try/catch class.forName() for image types relying on
//provided dependencies
}

private static final Set<MediaType> SUPPORTED_TYPES =
Expand Down
Expand Up @@ -765,13 +765,6 @@ public void checkInitialization(InitializableProblemHandler handler) throws Tika
return;
}
StringBuilder sb = new StringBuilder();
try {
Class.forName("com.levigo.jbig2.JBIG2ImageReader");
} catch (ClassNotFoundException e) {
sb.append("JBIG2ImageReader not loaded. jbig2 files will be ignored\n");
sb.append("See https://pdfbox.apache.org/2.0/dependencies.html#jai-image-io\n");
sb.append("for optional dependencies.\n");
}
try {
Class.forName("com.github.jaiimageio.impl.plugins.tiff.TIFFImageWriter");
} catch (ClassNotFoundException e) {
Expand Down

0 comments on commit ee9e4f4

Please sign in to comment.