|
|
@@ -114,9 +114,12 @@ public class PicExifUtil {
|
|
|
if(exifIFD0Directory != null) {
|
|
|
builder.imageWidth(exifSubIFDDirectory.getInteger(ExifSubIFDDirectory.TAG_EXIF_IMAGE_WIDTH));
|
|
|
builder.imageHeight(exifSubIFDDirectory.getInteger(ExifSubIFDDirectory.TAG_EXIF_IMAGE_HEIGHT));
|
|
|
+ //拍摄时间
|
|
|
+ builder.createTime(exifSubIFDDirectory.getDate(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL).getTime());
|
|
|
} else {
|
|
|
log.info("============图片未获取到宽高 ");
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
//媒体类型
|
|
|
FileTypeDirectory fileTypeDirectory = metadata.getFirstDirectoryOfType(FileTypeDirectory.class);
|
|
|
@@ -137,9 +140,9 @@ public class PicExifUtil {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
-// public static void main(String[] args) throws FileNotFoundException {
|
|
|
-// String filePath = "C:\\Users\\86139\\Desktop\\DJI_20241024142543_0008_V.jpeg";
|
|
|
-// File file = new File(filePath);
|
|
|
-// getPicExif(new FileInputStream(file),false);
|
|
|
-// }
|
|
|
+ public static void main(String[] args) throws FileNotFoundException {
|
|
|
+ String filePath = "C:\\Users\\86139\\Desktop\\DJI_20241024142543_0008_V.jpeg";
|
|
|
+ File file = new File(filePath);
|
|
|
+ getPicExif(new FileInputStream(file),false);
|
|
|
+ }
|
|
|
}
|