问题描述
- java-exif 如何读取镜头信息
-
public class ExifTester {
public static void main(String[] args) throws Exception {
File jpegFile = new File("C:/1.JPG");
Metadata metadata = JpegMetadataReader.readMetadata(jpegFile);
Directory exif = metadata.getDirectory(ExifDirectory.class);
Iterator tags = exif.getTagIterator();
while (tags.hasNext()) {
Tag tag = (Tag) tags.next();
System.out.println(tag);
}}
}
获取:
[Exif] Make - Canon
[Exif] Model - Canon EOS 650D
[Exif] Orientation - Top, left side (Horizontal / normal)
[Exif] X Resolution - 72 dots per inch
[Exif] Y Resolution - 72 dots per inch
[Exif] Resolution Unit - Inch
[Exif] Date/Time - 2013:05:26 18:30:49
[Exif] Artist -
[Exif] YCbCr Positioning - Datum point
[Exif] Copyright -
[Exif] Exposure Time - 1/160 sec
[Exif] F-Number - F2.8
[Exif] Exposure Program - Manual control
[Exif] ISO Speed Ratings - 200
[Exif] Unknown tag (0x8830) - 2
[Exif] Unknown tag (0x8832) - 200
[Exif] Exif Version - 2.30
[Exif] Date/Time Original - 2013:05:26 18:30:49
[Exif] Date/Time Digitized - 2013:05:26 18:30:49
[Exif] Components Configuration - YCbCr
[Exif] Shutter Speed Value - 1/165 sec
[Exif] Aperture Value - F2.8
[Exif] Exposure Bias Value - 0 EV
[Exif] Metering Mode - Multi-segment
[Exif] Flash - Flash did not fire, auto
[Exif] Focal Length - 200.0 mm
[Exif] User Comment -
[Exif] Sub-Sec Time - 00
[Exif] Sub-Sec Time Original - 00
[Exif] Sub-Sec Time Digitized - 00
[Exif] FlashPix Version - 1.00
[Exif] Color Space - sRGB
[Exif] Exif Image Width - 5184 pixels
[Exif] Exif Image Height - 3456 pixels
[Exif] Focal Plane X Resolution - 447/2592000 inches
[Exif] Focal Plane Y Resolution - 199/1152000 inches
[Exif] Focal Plane Resolution Unit - Inches
[Exif] Custom Rendered - Normal process
[Exif] Exposure Mode - Manual exposure
[Exif] White Balance - Auto white balance
[Exif] Scene Capture Type - Standard
[Exif] Unknown tag (0xa430) -
[Exif] Unknown tag (0xa431) - 044021026374
[Exif] Unknown tag (0xa432) - 70/1 200/1 0/1 0/1
[Exif] Unknown tag (0xa434) - EF70-200mm f/2.8L IS II USM 此行是镜头信息,如何获取
[Exif] Unknown tag (0xa435) - 000040eba4
[Exif] Compression - JPEG (old-style)
[Exif] Thumbnail Offset - 10924 bytes
[Exif] Thumbnail Length - 11899 bytes
[Exif] Thumbnail Data - [11899 bytes of thumbnail data]