Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image thumbnails are rotated sometimes #336

Closed
gempir opened this issue Jul 16, 2022 · 3 comments · Fixed by #366
Closed

Image thumbnails are rotated sometimes #336

gempir opened this issue Jul 16, 2022 · 3 comments · Fixed by #366
Assignees
Labels

Comments

@gempir
Copy link
Contributor

gempir commented Jul 16, 2022

In some cases (Can't figure out which yet) image thumbnails are rotated.

Example Picture:
https://files.catbox.moe/8c5ref.jpeg

image
image

@Mm2PL
Copy link
Contributor

Mm2PL commented Jul 16, 2022

This probably happens because we might ignore exif rotation info

$ file 8c5ref.jpeg
8c5ref.jpeg: JPEG image data, JFIF standard 1.01, resolution (DPI), density 300x300, segment length 20, Exif Standard: 
[TIFF image data, big-endian, direntries=14, manufacturer=Apple, model=iPhone 12, orientation=upper-right, xresolution=198, 
yresolution=206, resolutionunit=2, software=15.1.1, datetime=2022:07:16 00:19:47, hostcomputer=iPhone 12], baseline, 
precision 8, 4032x3024, components 3

@leon-richardt
Copy link
Contributor

leon-richardt commented Jul 16, 2022

exiftool 8c5ref.jpeg gives: Orientation: Rotate 90 CW (raw value: 6)

Entire Output
ExifTool Version Number         : 12.42
File Name                       : 8c5ref.jpeg
Directory                       : .
File Size                       : 3.2 MB
File Modification Date/Time     : 2022:07:16 11:30:58+02:00
File Access Date/Time           : 2022:07:16 11:31:07+02:00
File Inode Change Date/Time     : 2022:07:16 11:31:01+02:00
File Permissions                : -rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Exif Byte Order                 : Big-endian (Motorola, MM)
Make                            : Apple
Camera Model Name               : iPhone 12
Orientation                     : Rotate 90 CW
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : 15.1.1
Modify Date                     : 2022:07:16 00:19:47
Host Computer                   : iPhone 12
Tile Width                      : 512
Tile Length                     : 512
Y Cb Cr Positioning             : Centered
Exposure Time                   : 1/25
F Number                        : 1.6
Exposure Program                : Program AE
ISO                             : 1000
Exif Version                    : 0232
Date/Time Original              : 2022:07:16 00:19:47
Create Date                     : 2022:07:16 00:19:47
Offset Time                     : +02:00
Offset Time Original            : +02:00
Offset Time Digitized           : +02:00
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/25
Aperture Value                  : 1.6
Brightness Value                : -2.229301732
Exposure Compensation           : 0
Metering Mode                   : Multi-segment
Flash                           : Off, Did not fire
Focal Length                    : 4.2 mm
Subject Area                    : 1397 963 291 291
Run Time Flags                  : Valid
Run Time Value                  : 944815254757708
Run Time Scale                  : 1000000000
Run Time Epoch                  : 0
Acceleration Vector             : 0.01231019385 -1.00263679 -0.002108704532
Sub Sec Time Original           : 229
Sub Sec Time Digitized          : 229
Flashpix Version                : 0100
Color Space                     : Uncalibrated
Exif Image Width                : 4032
Exif Image Height               : 3024
Sensing Method                  : One-chip color area
Scene Type                      : Directly photographed
Exposure Mode                   : Auto
White Balance                   : Auto
Focal Length In 35mm Format     : 26 mm
Scene Capture Type              : Standard
Lens Info                       : 1.549999952-4.2mm f/1.6-2.4
Lens Make                       : Apple
Lens Model                      : iPhone 12 back dual wide camera 4.2mm f/1.6
Composite Image                 : General Composite Image
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Altitude Ref                : Above Sea Level
GPS Speed Ref                   : km/h
GPS Speed                       : 0.2099999934
GPS Img Direction Ref           : True North
GPS Img Direction               : 34.52927781
GPS Dest Bearing Ref            : True North
GPS Dest Bearing                : 34.52927781
GPS Horizontal Positioning Error: 6.100446014 m
XMP Toolkit                     : XMP Core 6.0.0
Creator Tool                    : 15.1.1
Date Created                    : 2022:07:16 00:19:47
Region Area Y                   : 0.31980952380952388, 0.7420000000000001
Region Area W                   : 0.0754285714285714, 0.071238095238095267
Region Area X                   : 0.34809523809523807, 0.50314285714285711
Region Area H                   : 0.10057142857142859, 0.094285714285714306
Region Area Unit                : normalized, normalized
Region Type                     : Face, Face
Region Extensions Angle Info Yaw: 0
Region Extensions Angle Info Roll: 270
Region Extensions Confidence Level: 780
Region Extensions Face ID       : 4
Region Applied To Dimensions H  : 3168
Region Applied To Dimensions W  : 4224
Region Applied To Dimensions Unit: pixel
MPF Version                     : 0100
Number Of Images                : 2
MP Image Flags                  : (none)
MP Image Format                 : JPEG
MP Image Type                   : Undefined
MP Image Length                 : 292868
MP Image Start                  : 2895485
Dependent Image 1 Entry Number  : 0
Dependent Image 2 Entry Number  : 0
Profile CMM Type                : Apple Computer Inc.
Profile Version                 : 4.0.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 2017:07:07 13:22:32
Profile File Signature          : acsp
Primary Platform                : Apple Computer Inc.
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : Apple Computer Inc.
Device Model                    : 
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : Apple Computer Inc.
Profile ID                      : ca1a9582257f104d389913d5d1ea1582
Profile Description             : Display P3
Profile Copyright               : Copyright Apple Inc., 2017
Media White Point               : 0.95045 1 1.08905
Red Matrix Column               : 0.51512 0.2412 -0.00105
Green Matrix Column             : 0.29198 0.69225 0.04189
Blue Matrix Column              : 0.1571 0.06657 0.78407
Red Tone Reproduction Curve     : (Binary data 32 bytes, use -b option to extract)
Chromatic Adaptation            : 1.04788 0.02292 -0.0502 0.02959 0.99048 -0.01706 -0.00923 0.01508 0.75168
Blue Tone Reproduction Curve    : (Binary data 32 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 32 bytes, use -b option to extract)
Image Width                     : 4032
Image Height                    : 3024
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Run Time Since Power Up         : 10 days 22:26:55
Aperture                        : 1.6
Image Size                      : 4032x3024
Megapixels                      : 12.2
Scale Factor To 35 mm Equivalent: 6.2
Shutter Speed                   : 1/25
Create Date                     : 2022:07:16 00:19:47.229+02:00
Date/Time Original              : 2022:07:16 00:19:47.229+02:00
Modify Date                     : 2022:07:16 00:19:47+02:00
GPS Altitude                    : 2.1 m Above Sea Level
GPS Latitude                    : 52 deg 22' 23.48" N
GPS Longitude                   : 4 deg 53' 58.17" E
MP Image 2                      : (Binary data 292868 bytes, use -b option to extract)
Circle Of Confusion             : 0.005 mm
Field Of View                   : 69.4 deg
Focal Length                    : 4.2 mm (35 mm equivalent: 26.0 mm)
GPS Position                    : 52 deg 22' 23.48" N, 4 deg 53' 58.17" E
Hyperfocal Distance             : 2.27 m
Light Value                     : 2.7
Lens ID                         : iPhone 12 back dual wide camera 4.2mm f/1.6

@pajlada pajlada added the bug label Jul 23, 2022
@leon-richardt
Copy link
Contributor

libvips can correct orientation based on EXIF tags relatively easily: https://pkg.go.dev/github.com/davidbyttow/govips/v2/vips#ImageRef.AutoRotate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants