0
votes

I need to rotate images if needed at the server side. I used metadata-extractor package and apache commons-imaging for this purposes, but for some photos taken on Android I can't get any orientation field values with java, but any exif metadata reader sites can.

For example:

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

And it's metadata extracted with 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

Is it possible to get correct orientation field value?

1
And what is the rotation according these metadata readers?blackapps
So the website does not show the image ok.In landscape. I downloaded the image and WIndows shows it like te website does. Are there any image viewer that show th epicture in portrait mode.blackapps
Indeed there is rotation infpormation as my Android viewer shows it in portrait mode.blackapps
Irfanview shows it in landscape too and sais: Filename - to-rotate.jpg Make - samsung Model - SM-T585 Orientation - Right top. Whatever that means.blackapps

1 Answers

0
votes