gpt4 book ai didi

java - Android 照片上的 EXIF 方向字段为空

转载 作者:行者123 更新时间:2023-12-01 23:18:07 24 4
gpt4 key购买 nike

如果服务器端需要,我需要旋转图像。为此,我使用了metadata-extractor包和apache commons-imaging,但是对于在Android上拍摄的一些照片,我无法使用java获取任何方向字段值,但任何exif元数据阅读器网站都可以。

例如:

https://imgbbb.com/image/LVtrUD -- 图片

它是使用 Apache Imaging 提取的元数据。

11.10.2019 14:55:35.825 INFO  [http-bio-8080-exec-11] **.utils.ExifImageUtils:44 - ORIENTATION 0
[JPEG] - Compression Type = Baseline
[JPEG] - Data Precision = 8 bits
[JPEG] - Image Height = 2448 pixels[JPEG] - Image Width = 3264 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
[JFIF] - Version = 1.1
[JFIF] - Resolution Units = inch
[JFIF] - X Resolution = 72 dots
[JFIF] - Y Resolution = 72 dots
[JFIF] - Thumbnail Width Pixels = 0
[JFIF] - Thumbnail Height Pixels = 0
[Exif IFD0] - Make = samsung
[Exif IFD0] - Model = SM-T585
[Exif IFD0] - X Resolution = 72 dots per inch
[Exif IFD0] - Y Resolution = 72 dots per inch
[Exif IFD0] - Resolution Unit = Inch
[Exif IFD0] - Software = T585XXU5CSB1
[Exif IFD0] - Date/Time = 2019:09:12 09:28:02
[Exif IFD0] - YCbCr Positioning = Center of pixel array
[Exif SubIFD] - Exposure Time = 1/33 sec
[Exif SubIFD] - F-Number = f/1.9
[Exif SubIFD] - Exposure Program = Program normal
[Exif SubIFD] - ISO Speed Ratings = 160
[Exif SubIFD] - Exif Version = 2.20
[Exif SubIFD] - Date/Time Original = 2019:09:12 09:28:02
[Exif SubIFD] - Date/Time Digitized = 2019:09:12 09:28:02
[Exif SubIFD] - Components Configuration = YCbCr
[Exif SubIFD] - Shutter Speed Value = 1/33 sec
[Exif SubIFD] - Aperture Value = f/1.9
[Exif SubIFD] - Brightness Value = 1.55
[Exif SubIFD] - Exposure Bias Value = 0 EV
[Exif SubIFD] - Max Aperture Value = f/1.9
[Exif SubIFD] - Metering Mode = Center weighted average
[Exif SubIFD] - Flash = Flash did not fire
[Exif SubIFD] - Focal Length = 2.9 mm
[Exif SubIFD] - Makernote = [98 values]
[Exif SubIFD] - User Comment =
[Exif SubIFD] - Sub-Sec Time = 0731
[Exif SubIFD] - Sub-Sec Time Original = 0731
[Exif SubIFD] - Sub-Sec Time Digitized = 0731
[Exif SubIFD] - FlashPix Version = 1.00
[Exif SubIFD] - Color Space = sRGB
[Exif SubIFD] - Exif Image Width = 3264 pixels
[Exif SubIFD] - Exif Image Height = 2448 pixels
[Exif SubIFD] - Exposure Mode = Auto exposure
[Exif SubIFD] - White Balance Mode = Auto white balance
[Exif SubIFD] - Focal Length 35 = 27 mm
[Exif SubIFD] - Scene Capture Type = Standard
[Exif SubIFD] - Unique Image ID = J08LLJA00AM J08LLLJ01AA
[Interoperability] - Interoperability Index = Recommended Exif Interoperability Rules (ExifR98)
[Interoperability] - Interoperability Version = 1.00
[Exif Thumbnail] - Image Width = 512 pixels
[Exif Thumbnail] - Image Height = 384 pixels
[Exif Thumbnail] - Compression = JPEG (old-style)
[Exif Thumbnail] - Orientation = Unknown (0)
[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 = 1008 bytes
[Exif Thumbnail] - Thumbnail Length = 33822 bytes
[Huffman] - Number of Tables = 4 Huffman tables
[File Type] - Detected File Type Name = JPEG
[File Type] - Detected File Type Long Name = Joint Photographic Experts Group
[File Type] - Detected MIME Type = image/jpeg
[File Type] - Expected File Name Extension = jpg
[File] - File Name = 1.jpg
[File] - File Size = 3834043 bytes
[File] - File Modified Date = Fri Oct 11 14:55:34 +03:00 2019

是否可以获得正确的方向字段值?

最佳答案

终于使用 ExifTool ( https://www.sno.phy.queensu.ca/~phil/exiftool/ ) 和 Java Wrapper ( https://github.com/rkalla/exiftool ) 解决了我的问题

关于java - Android 照片上的 EXIF 方向字段为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58341145/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com