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

ClassNotFoundException: com.sun.media.imageio.plugins.tiff.BaselineTIFFTagSet #19

Closed
THausherr opened this issue Oct 15, 2015 · 1 comment
Milestone

Comments

@THausherr
Copy link

I tried using this library for a PDFBox build test, and got this:

java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun.media.imageio.plugins.tiff.BaselineTIFFTagSet
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:191)
at com.github.jaiimageio.impl.plugins.tiff.TIFFImageMetadata.parseIFD(TIFFImageMetadata.java:1510)
at com.github.jaiimageio.impl.plugins.tiff.TIFFImageMetadata.mergeNativeTree(TIFFImageMetadata.java:1603)
at com.github.jaiimageio.impl.plugins.tiff.TIFFImageMetadata.mergeTree(TIFFImageMetadata.java:1627)
at org.apache.pdfbox.tools.imageio.TIFFUtil.updateMetadata(TIFFUtil.java:115)
at org.apache.pdfbox.tools.imageio.ImageIOUtil.writeImage(ImageIOUtil.java:248)
at org.apache.pdfbox.tools.imageio.ImageIOUtil.writeImage(ImageIOUtil.java:147)
at org.apache.pdfbox.tools.imageio.ImageIOUtil.writeImage(ImageIOUtil.java:129)
at org.apache.pdfbox.tools.imageio.TestImageIOUtils.checkSaveResources(TestImageIOUtils.java:84)
at org.apache.pdfbox.tools.imageio.TestImageIOUtils.doTestFile(TestImageIOUtils.java:114)
at org.apache.pdfbox.tools.imageio.TestImageIOUtils.testRenderImage(TestImageIOUtils.java:272)

See the source code here:
https://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/imageio/TIFFUtil.java?view=markup&sortby=date

The cause is probably this:

ifd.setAttribute("tagSets", "com.sun.media.imageio.plugins.tiff.BaselineTIFFTagSet");

If I change the second parameter to "com.github.jaiimageio.plugins.tiff.BaselineTIFFTagSet" our tests pass. However we can't just change that line to set the github path, because we don't know which jars the users will use (we can't distribute jai_imageio).

@stain
Copy link
Member

stain commented Apr 3, 2017

This jai-imageio-core fork is created specifically to be distributable by open source projects, and is compatible with both GPL3 and Apache License 2.0. (that his however not true for the jai-imageio-jpeg2000 module)

However I agree that this backward compatibility should be there, so I've merged your PR #20. Thanks!

@stain stain closed this as completed Apr 3, 2017
@stain stain added this to the 1.3.2 milestone Apr 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants