我想摆出日期,特别是 picture.jpg 的拍摄时间。我在网上发现我可以用 (metadata-extractor) 处理这个问题,但无论我尝试什么都不会产生任何影响。你能指导我使用这个工具的最简单方法吗?
我的试炼就像
public class ImageMetadata{
public static void main(String[] arg){
Metadata metadata = null;
try{
FileInputStream InputStream
= new FileInputStream(
"X://2015//Java//renamePict//pict/IMGP0092.JPG");
metadata = ImageMetadataReader.readMetadata(InputStream);
} catch(Exception Ex) {ex.printStackTrace;}
System.out.println(metadata); // I know that perhaps I should use here some toString(). It is just try to check the compilation.
}
}
这给我带来了:
Exception in thread "main" java.lang.NoClassDefFoundError: com/adobe/xmp/XMPException
at com.drew.imaging.jpeg.JpegMetadataReader.<clinit>(JpegMetadataReader.java:53)
at com.drew.imaging.ImageMetadataReader.readMetadata(ImageMetadataReader.java:98)
at ImageMetadata.main(ImageMetadata.java:57)
Caused by: java.lang.ClassNotFoundException: com.adobe.xmp.XMPException
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)
... 3 more
Java 结果:1 构建成功(总时间:1 秒)
链接到
提前致谢!