import javaioFile;
import javautilIterator;
import comdrewimagingjpegJpegMetadataReader;
import comdrewimagingjpegJpegProcessingException;
import comdrewmetadataDirectory;
import comdrewmetadataMetadata;
import comdrewmetadataTag;
import comdrewmetadataexifExifDirectory;
import comdrewmetadataexifGpsDirectory;
import comdrewmetadatajpegJpegDirectory;
public class Test {
public static void main(String[] args){
File jpegFile = new File("F:/定位/DCIM/P20130116_125539jpg");
Metadata metadata;
try {
metadata = JpegMetadataReaderreadMetadata(jpegFile);
Directory exif = metadatagetDirectory(ExifDirectoryclass);
Iterator tags1 = exifgetTagIterator();
while (tags1hasNext()) {
Tag tag = (Tag)tags1next();
Systemoutprintln(tag);
}
Directory jpeg = metadatagetDirectory(JpegDirectoryclass);
Iterator tags2 = jpeggetTagIterator();
while (tags2hasNext()) {
Tag tag = (Tag)tags2next();
Systemoutprintln(tag);
}
Directory gps = metadatagetDirectory(GpsDirectoryclass);
Iterator tags3 = gpsgetTagIterator();
while (tags3hasNext()) {
Tag tag = (Tag)tags3next();
Systemoutprintln(tag);
}
} catch (JpegProcessingException e) {
eprintStackTrace();
}
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)