EasyImage
EasyImage copied to clipboard
Image orientation problem
Hello,
this library is really good and saves a lot of time but i found an issue with image orientation on Samsung phones. All pictures taken in portrait are saved rotated 90 degrees. When i take picture in landscape mode everything is fine. This is an issue that i found only on Samsung phones so far.
I'm using Samsung S3.
Yes the library just picks the image, Would be nice if the orientation changes and has an option to compress images without losing quality
I also have the same concerns, but i guess providing auto-rotation is quite not possible to support for all devices and all applications. Because it is actually not on device but also applications.
For instance, i have Sony Xperia Z3 and when i'm trying to get photo with default camera: it's not in the right rotation it should be, but when i try to pick with different camera application, it receives as it should be, just no problem.
So i'm thinking about implementing another step to display as a preview and put a rotate button on that screen. I don't know if that would be possible to implement such thing as option in library as well @jkwiecien ?
+1
Hmm I'm hitting the same problem. Anything saved using the camera doesn't appear to have the Exif attribute TAG_ORIENTATION set so it's impossible to know the orientation of the picture after it's saved.
Edit: I take that back - TAG_ORIENTATION is always 0, but the width/height seems ok. Nothing wrong with the library.
There is also an orientation that might be set inside MediaStore.Images.Media.ORIENTATION
.
So some devices set the orientation inside ExifInterface.TAG_ORIENTATION
, some of them inside the MediaStore
.
I was checking some other functionalities to include into my application and faced a library doesn't have this issue and digged little bit into and saw that there is a code snipped by Google to get exif information amd decide the orientation of the image... You may consider it: https://github.com/Yalantis/uCrop/blob/master/ucrop/src/main/java/com/yalantis/ucrop/util/ImageHeaderParser.java
I've this issue too, can you fix it ?
I found out the orientation is right when you don't turn it into bitmap but use is as file.
I use the file (file.getPath) and pass to an other activity and display with picasso " Picasso.with(mContext).load(new File(mPathPhoto))....."
I just want to confirm that the solution shown by @yayaa works really well to extract the orientation from the image and then rotate it accordingly!
It will be fixed in future?
By the way, with Support Library 25.2.0 Google introduce ExifInterface
can be used to fix this issue.
Any progress with this issue?
@dgngulcan In a comment you have said that
I found out the orientation is right when you don't turn it into bitmap but use is as file.
I want to set the image taken from camera into my imageview. how to load image without converting them into bitmap?
I have the same issue. Would be appreciated if this can be fixed.
I have the same problem for me a fast fix with an image library will not work . i need to send the image not just display in an ImageView please let us know if you have intentions on fixing this? thanks shimi
@qadirsuh sorry for the late response. One way to do is to give the file directly to the image loading library such as Glide such;
Glide.with(context)
.load(new File(imageUri.getPath()))
.into(imageView);
That will not help me i need to send the image to a web site for image recognition. I need the image saved on file with the right rotation Thanks
On Oct 30, 2017 17:42, "Dogan Gulcan" [email protected] wrote:
@qadirsuh https://github.com/qadirsuh sorry for the late response. One way to do is to give the file directly to the image loading library such as Glide such;
Glide.with(context) .load(new File(imageUri.getPath())) .into(imageView);
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jkwiecien/EasyImage/issues/43#issuecomment-340485232, or mute the thread https://github.com/notifications/unsubscribe-auth/ADfXYVMSM98WkBqEAMOy2UH20_x1Q_mpks5sxe5cgaJpZM4Hhp_7 .
I can't reproduce the problem on the sample app. Can someone help me with that? DOes that happen on sample app?
I tested on Galaxy S8 with portrait mode but always got landscape orientation.
Same issue on Samsung Galaxy S7. Here's how I got the degrees you can rotate after decoding to bitmap from the returned file path.
android.support.media.ExifInterface exif = new android.support.media.ExifInterface(filePath);
int rotation = exif.getAttributeInt(android.support.media.ExifInterface.TAG_ORIENTATION, android.support.media.ExifInterface.ORIENTATION_NORMAL);
Any updates on solving this problem.