Android-Image-Cropper icon indicating copy to clipboard operation
Android-Image-Cropper copied to clipboard

[BUG] - Image Rotates after clicking image via camera on lower Android versions

Open Devenom1 opened this issue 1 year ago • 2 comments

  • Lib Version [4.3.1]

Describe the bug The image taken via camera rotates (-90 degrees) after being captured. I've tried this with and without intent chooser. I've tried in on an emulator because that's where we do tests.

Happens on API level 26. Android 8 (Oreo). Not happening on Android 11. Might be happening on other API levels too. I haven't tested

To Reproduce Steps to reproduce the behavior:

  1. Go to main screen of sample app.
  2. Click on the 3rd button "Sample calling cropimage"
  3. Now in the next screen click on the 2nd button "Calling library directly with URI".
  4. Choose camera.
  5. Click an image
  6. Notice after capturing the image, it is rotated by -90 degrees.

Expected behavior On clicking an image via camera the image shouldn't rotate.

Media Rotating Image on Image-Cropper

Smartphone (please complete the following information):

  • Device: Android Studio Emulator with Pixel 2 configuration
  • OS: Android 8 (Oreo) Api Level 26 image

Additional context I might be a little busy but if I get time I will try to look into it and open a PR. I think this is what @Jeyaseelan2528 meant in issue #292

Devenom1 avatar Aug 15 '22 15:08 Devenom1

Hey @Devenom1 thanks for the detailed PR, helps a lot.

I try to reproduce, but could not, so maybe is a specific case of brand/os. Will try with the simulator you use later.

but from your video and steps

Notice after capturing the image, it is rotated by -90 degrees.

This may not be the library, but the camera itself. Could you try to open the camera app and take a picture so we check if will rotate too? Because taking the picture before we accept is the device camera working, not the lib 🤔

Canato avatar Aug 15 '22 15:08 Canato

Hey @Canato thanks for the quick response as always.

Here is a video from the default camera app on the android studio emulator. It doesn't rotate with the default camera app. Camera not rotating on default camera app

I remember facing this issue before when I made a local copy of the Arthur Hub Library. I had fixed this issue on that but now I've deleted that and I'm too lazy to check my changes on github. It was a mess. I switched to CanHub library completely.

Devenom1 avatar Aug 15 '22 16:08 Devenom1

This is also probably related to #439 where handling exif values is buggy

vanniktech avatar Oct 19 '22 10:10 vanniktech

Could you please try the latest release, 4.4.0 and reopen this issue if it still persists?

vanniktech avatar Oct 24 '22 13:10 vanniktech