图像处理1_开源图片详细信息提取metadata-extractor

凌琦
2023-12-01

网站:https://drewnoakes.com/code/exif/

GitHub:https://github.com/drewnoakes/metadata-extractor/

参考网站:http://www.programgo.com/article/10671752428/


使用版本:

[html]  view plain  copy
  1. <dependency>  
  2.     <groupId>com.drewnoakes</groupId>  
  3.     <artifactId>metadata-extractor</artifactId>  
  4.     <version>2.8.1</version>  
  5. </dependency>  


[java]  view plain  copy
  1. import com.drew.imaging.ImageMetadataReader;  
  2. import com.drew.imaging.ImageProcessingException;  
  3. import com.drew.metadata.Directory;  
  4. import com.drew.metadata.Metadata;  
  5. import com.drew.metadata.Tag;  
  6.   
  7. import java.io.File;  
  8. import java.io.IOException;  
  9.   
  10. /** 
  11.  * @author wyyl1 
  12.  */  
  13. public class Test {  
  14.   
  15.     /** 
  16.      * 图片数据元提取 
  17.      */  
  18.     public static void metadataExtractor(){  
  19.         File jpegFile = new File("37.jpg");  
  20.         try {  
  21.             Metadata metadata = ImageMetadataReader.readMetadata(jpegFile);  
  22.             for (Directory directory : metadata.getDirectories()) {  
  23.                 for (Tag tag : directory.getTags()) {  
  24.                     System.out.println(tag);  
  25.                 }  
  26.             }  
  27.         } catch (ImageProcessingException e) {  
  28.             e.printStackTrace();  
  29.         } catch (IOException e) {  
  30.             e.printStackTrace();  
  31.         }  
  32.     }  
  33.   
  34.     public static void main(String[] args) {  
  35.         metadataExtractor();  
  36.     }  
  37. }  

输出:

[JPEG] Compression Type - Baseline
[JPEG] Data Precision - 8 bits
[JPEG] Image Height - 2336 pixels
[JPEG] Image Width - 4160 pixels
[JPEG] Number of Components - 3
[JPEG] Component 1 - Y component: Quantization table 0, Sampling factors 2 horiz/2 vert
[JPEG] Component 2 - Cb component: Quantization table 1, Sampling factors 1 horiz/1 vert
[JPEG] Component 3 - Cr component: Quantization table 1, Sampling factors 1 horiz/1 vert
[Exif Thumbnail] Image Width - 512 pixels
[Exif Thumbnail] Image Height - 288 pixels
[Exif Thumbnail] Thumbnail Compression - JPEG (old-style)
[Exif Thumbnail] Orientation - Top, left side (Horizontal / normal)
[Exif Thumbnail] X Resolution - 72 dots per inch
[Exif Thumbnail] Y Resolution - 72 dots per inch
[Exif Thumbnail] Resolution Unit - Inch
[Exif Thumbnail] Thumbnail Offset - 1096 bytes
[Exif Thumbnail] Thumbnail Length - 29151 bytes
[Exif IFD0] Image Width - 4160 pixels
[Exif IFD0] Image Height - 2336 pixels
[Exif IFD0] Bits Per Sample - 8 8 8 bits/component/pixel
[Exif IFD0] Make - HUAWEI
[Exif IFD0] Model - H60-L02
[Exif IFD0] Orientation - Top, left side (Horizontal / normal)
[Exif IFD0] X Resolution - 72 dots per inch
[Exif IFD0] Y Resolution - 72 dots per inch
[Exif IFD0] Resolution Unit - Inch
[Exif IFD0] Software - H60-L02V100R001CHNC00B313
[Exif IFD0] Date/Time - 2015:04:17 11:07:20
[Exif IFD0] YCbCr Positioning - Center of pixel array
[Exif IFD0] Device Setting Description - 105 112 112 0
[Exif SubIFD] Document Name - 
[Exif SubIFD] Exposure Time - 1/1848 sec
[Exif SubIFD] F-Number - f/2.0
[Exif SubIFD] Exposure Program - Program normal
[Exif SubIFD] ISO Speed Ratings - 50
[Exif SubIFD] Exif Version - 2.10
[Exif SubIFD] Date/Time Original - 2015:04:17 11:07:20
[Exif SubIFD] Date/Time Digitized - 2015:04:17 11:07:20
[Exif SubIFD] Components Configuration - YCbCr
[Exif SubIFD] Shutter Speed Value - 1/1847 sec
[Exif SubIFD] Aperture Value - f/2.0
[Exif SubIFD] Brightness Value - 0
[Exif SubIFD] Exposure Bias Value - 0 EV
[Exif SubIFD] Metering Mode - Average
[Exif SubIFD] White Balance - Daylight
[Exif SubIFD] Flash - Flash did not fire
[Exif SubIFD] Focal Length - 3.79 mm
[Exif SubIFD] Makernote - [21 bytes]
[Exif SubIFD] User Comment - Hisilicon K3
[Exif SubIFD] Sub-Sec Time - 378554
[Exif SubIFD] Sub-Sec Time Original - 378554
[Exif SubIFD] Sub-Sec Time Digitized - 378554
[Exif SubIFD] FlashPix Version - 1.00
[Exif SubIFD] Color Space - sRGB
[Exif SubIFD] Exif Image Width - 4160 pixels
[Exif SubIFD] Exif Image Height - 2336 pixels
[Exif SubIFD] Sensing Method - One-chip color area sensor
[Exif SubIFD] File Source - Digital Still Camera (DSC)
[Exif SubIFD] Scene Type - Directly photographed image
[Exif SubIFD] Custom Rendered - Custom process
[Exif SubIFD] Exposure Mode - Auto exposure
[Exif SubIFD] White Balance Mode - Auto white balance
[Exif SubIFD] Digital Zoom Ratio - 1
[Exif SubIFD] Focal Length 35 - 28mm
[Exif SubIFD] Scene Capture Type - Standard
[Exif SubIFD] Gain Control - None
[Exif SubIFD] Contrast - None
[Exif SubIFD] Saturation - None
[Exif SubIFD] Sharpness - None
[Exif SubIFD] Subject Distance Range - Unknown
[File] File Name - 37.jpg
[File] File Size - 3156289 bytes
[File] File Modified Date - Tue Apr 21 23:00:32 CST 2015
[Interoperability] Interoperability Index - Recommended Exif Interoperability Rules (ExifR98)

[Interoperability] Interoperability Version - 1.00


原文来自:http://blog.csdn.net/wyyl1/article/details/45830073

 类似资料: