question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exif rotation not applied for locally saved images/images taken with camera on some devices

See original GitHub issue

Hi, 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mariocommented, Jan 20, 2020

@colinrtwhite I’ll take a look at this one tomorrow.

0reactions
dominikgoldcommented, Jan 28, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found