Exif rotation not applied for locally saved images/images taken with camera on some devices
See original GitHub issueHi, first off, thanks for the great work on this library.
We’re facing one issue when using Coil for loading images with Exif rotation which are saved on the device, using the load(Uri)
function. The Exif rotation is not applied at all. This was reproducible on 2 of our test devices, an LG G3 and an LG G2 Mini, both API 21. I’m assuming it’s the same on other devices with API 21, though I don’t know for sure.
The ExifInterface.getRotationDegrees()
call used in BitmapFactoryDecoder.decode()
always returns 0 on these devices.
Here’s a small sample app demonstrating the issue: https://github.com/dominikgold/CoilExifRotationTest
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Android camera unexplainable rotation on capture for some ...
Funny thing is, there is EXIF headers but no rotation element. If I set the rotation manually to 90 degrees, the images come...
Read more >EXIF orientation handling is a ghetto - Dave Perrett
Recently one particular image stuck out on the staging server as un-rotated, while it worked fine locally using ImageMagick/Dragonfly. Not ...
Read more >CameraX use case rotations - Android Developers
The ImageCapture use case should take pictures with the correct rotation. ... The same can be applied to devices that don't rotate to...
Read more >Images taken with ACTION_IMAGE_CAPTURE are not rotated ...
When there's an image taken, one can use the Exif Attributes to figure out the orientation of the image, then rotate the image....
Read more >should consider using exif orientation flag when displaying ...
Users are increasingly likely to email photos directly from iPhones etc, most of which will set the Orientation flag but not actually rotate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@colinrtwhite I’ll take a look at this one tomorrow.
Hey @mario, thank you for looking into this. Maybe for some clarification, the images definitely have an Exif rotation set, and it’s also readable, when using the ExifInterface(String) constructor. Our current suspicion is that the Exif rotation gets lost/can’t be read anymore after the file is converted to an okio BufferedSource in
FileFetcher
. However, it it is hard to reproduce, since it seems to happen only on a few devices. We’ll try to find a fix and then I’ll update this issue.