Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5711 Incorrect rotation in Edit Image while uploading. #5760

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

acemarco1311
Copy link

@acemarco1311 acemarco1311 commented Jun 20, 2024

Description (required)

Fixes #5711. While uploading, when click "Edit Image" and then perform no rotation (click Save, or click Rotate 4 times to get back to the original position and Save), the image will be automatically rotated 90 degrees.

What changes did you make and why?
Change rotateImage() function implementation in edit/TransformImageImpl.kt. When the given degree is not expected (e.g 0), the transformation of the image should be default instead of rotating 90 degree (LLJTran.ROT_90).

Tests performed (required)

Tested on Pixel 8 with API level 35.

Reproduce:

  1. Open app.
  2. Upload image.
  3. Click "Edit Image".
  4. Click "Save" or "Rotate" 4 times so that the image will be in the original position then "Save".

Error Behavior:

error_final.mp4

Expected Behavior:
The image will be shown as original instead of being rotated 90 degree after clicking "Save".

Screenshots (for UI changes only)

expected_final.mp4

@nicolas-raoul
Copy link
Member

Hi Toan,

Would you mind checking whether your change works with all JPGs at https://github.com/recurser/exif-orientation-examples ?

Thanks! 🙂

I feel like different pictures have different properties, and what works for one picture might not work for another.

Idea potentially for another pull request:
It would be great if we had a small repository (could be a Google Drive for now) with the example pictures we encountered so far, if the repository above is not enough. Ideally unit tests would use these pictures (or simpler+smaller JPGs) to check rotation in the UI and in the resulting image output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Incorrect rotation shown in "Edit Image"
3 participants