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: Pictures in portrait orientation are being sent flipped (in horizontal) #1552

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

KhushamBansal
Copy link

@KhushamBansal KhushamBansal commented Jan 10, 2025

  • Code formatting and import sorting has been done with dart format lib/ test/ and dart run import_sorter:main --no-comments
  • The commit message uses the format of Conventional Commits
  • The commit message describes what has been changed, why it has been changed and how it has been changed
  • Every new feature or change of the design/GUI is linked to an approved design proposal in an issue
  • Every new feature in the app or the build system has a strategy how this will be tested and maintained from now on for every release, e.g. a volunteer who takes over maintainership

Pull Request has been tested on:

  • Android

Approach:

To resolve this issue, the image data needs to be adjusted according to its EXIF orientation before being displayed. By reading the EXIF metadata from the image and applying the necessary transformations (rotations and flips), we can ensure that images are displayed with the correct orientation.
Closes #1501

…zontal)

Imports: Added package:exif/exif.dart and package:image/image.dart to handle image metadata and manipulation.
_fixExifOrientation Method: This method reads the EXIF orientation from the image data and adjusts the image accordingly using the image package.
Modifying _load Method: After downloading the image data (remoteData or data.bytes), we apply _fixExifOrientation before setting _imageData.
Error Handling: If there's an error while adjusting the orientation, the original image data is used, ensuring the app doesn't crash.
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.

Pictures are being rotated 90 deg
1 participant