android-crop icon indicating copy to clipboard operation
android-crop copied to clipboard

Issue with exifs on samsung devices

Open iovorobiev opened this issue 9 years ago • 7 comments

There are some issues with crop on samsung devices when doing non-square crop. It caused by rotating matrix by -exif_rotate value and than adding exif. Suppose I want to crop picture to get 16:9 rectangle and then set it to ImageView by using standard setImageUri() method. cropping

then I getting this

cropped

If I will use a library which reads exif and applies rotating then I getting this

with_glide_2

So, the main issue, is when we apply exif to cropped picture, we rotate the whole bitmap and change it's dimensions from 16:9 to 9:16. Also, if we not apply exif parameters when setting picture to image view the picture will be rotated by minus exif rotation angle and stretched to given dimensions. I've fixed this this issue in mine pull request https://github.com/jdamcd/android-crop/pull/116. If you have another solution, please fix it.

iovorobiev avatar May 14 '15 14:05 iovorobiev

Are you using the same Uri for input & output?

I'm keen to fix this, but have trouble reproducing the issue. Are you using a specific camera app? Or maybe you could provide an image with problem EXIF data.

jdamcd avatar May 21 '15 18:05 jdamcd

I working on camera app ... And I'm using same uri for storing images. ..but what u mean by exifs ... You asked about android interface .??. On May 21, 2015 11:54 PM, "Jamie McDonald" [email protected] wrote:

Are you using the same Uri for input & output?

I'm keen to fix this, but have trouble reproducing the issue. Are you using a specific camera app? Or maybe you could provide an image with problem EXIF data.

— Reply to this email directly or view it on GitHub https://github.com/jdamcd/android-crop/issues/117#issuecomment-104378126 .

sridharkrishna avatar May 21 '15 18:05 sridharkrishna

@jdamcd yes, I am using the same uri for input and output. I use a standard camera app on Samsung Galaxy Note 2. For me this issue reproduces only on samsung devices.

iovorobiev avatar May 22 '15 03:05 iovorobiev

we also see the issue on samsung device, is that possible to make a fast fix for that? Thanks!!

kungfucop avatar May 22 '15 15:05 kungfucop

I can reliably reproduce this in the 1.0.0 release on a Samsung Galaxy S4 with Android 4.4.2.

dkozel avatar Jun 01 '15 10:06 dkozel

Today I found out that it's possibly related not only to exif itself but also the Uri handling. When opening an image via the "last" section of my system gallery app I could reproduce the bug with the wrong rotation, since the Uri was shortened by the gallery app somehow. After resolving the shortened Uri to the full Uri of the file it worked correctly again. I fixed this in my forked repo and will probably make a pull request during the next couple of days

GameDevLlama avatar Dec 19 '15 15:12 GameDevLlama

@TheWhiteLlama , Do you have an fix for the issues mentioned through out this thread ? Please provide your branch and code changes . will be helpful.

thameemulansari avatar Dec 29 '16 10:12 thameemulansari