Coil: Coil should automatically rotate images based on Exif information

Created on 18 Aug 2019  路  3Comments  路  Source: coil-kt/coil

Describe the bug
When images have rotation information embedded within their Exif information, Coil should use that to automatically rotate the image correctly.

This is something that other image libraries (Glide, Picasso) do already. Using the AndroidX ExifInterface library allows you to extract the orientation information from any Uri / InputStream.

To Reproduce
You can use this sample image.

Expected behavior
The image should be rotated correctly.

Logs/Screenshots
n/a

Library version
0.6.1

bug

Most helpful comment

FWIW, the case I was testing was loading the image via Uri - specifically, from a local ContentProvider. I suppose a FileProvider generated Uri would be similar enough for testing purposes.

All 3 comments

Thanks for the report. Coil already uses the AndroidX Exif library as part of BitmapFactoryDecoder and should be automatically handling rotations, but I'll run the sample image to see what Coil's missing. I have a test here as well to cover all the rotations.

FWIW, the case I was testing was loading the image via Uri - specifically, from a local ContentProvider. I suppose a FileProvider generated Uri would be similar enough for testing purposes.

Confirmed. Going to look into fixing this today.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vegeta2102 picture vegeta2102  路  6Comments

digitalheir picture digitalheir  路  4Comments

GeniusRUS picture GeniusRUS  路  4Comments

wooldridgetm picture wooldridgetm  路  3Comments

ZacSweers picture ZacSweers  路  4Comments