commcare-android
commcare-android copied to clipboard
Respect image orientation during resizing
Bug Description
When image resizing is applied to captured images, EXIF data is currently getting stripped.
Current Behavior
Since most Android cameras do not natively rotate the pixels in a photo but instead set the orientation in EXIF data, resized images do not display in the same orientation as the original captured photo
Expected Behavior
Resized images should maintain the correct orientation as the original captured photo.
Reproduction Steps
Note: These steps assume you have basic knowledge of navigating and using the CommCare platform. If you are unfamiliar with how to perform basic setup steps, a getting started guide is available here.
- Create a CCHQ app that captures images.
- Open the camera app and take a picture
- Check and note the image’s EXIF orientation data. You can use free online platforms like Ezgif / Metadata2Go to do so.
- Install the app on an Android device
- When you get to a screen with an image capture question, capture the photo by choosing the above photo you clicked from your phone.
- After form submission, navigate to Submit History report on HQ and download the attachment
- Check the resized image’s EXIF orientation data
- Observe that the resized image on HQ does not include the orientation data of the original captured photo.
Possible Solution
Passing through some EXIF information during the resizing process or reading.
Additional Information/Context
Keep in mind that it may not be possible to replicate the issue on all devices.
Environment details (OS name and version, etc.)
No response
Other EXIF respect use case: https://github.com/dimagi/commcare-android/issues/2689
/bounty $150
💎 $150 bounty • Dimagi, Inc
This issue is eligible for rewards from CommCare's Open Source Bounty Program.
Contribution Prerequisites
Before you proceed, please read through the details of the CommCare Bounty Program
- Make sure that you meet the eligibility criteria and have fulfilled all the requirements
- We recommend creating appropriate accounts and signing the CLA ahead of time if you are planning on pursuing a bounty for your open source contribution
Steps to solve
-
Start working: Comment
/attempt #2743
with your implementation plan -
Submit work: Create a pull request including
/claim #2743
in the PR body to claim the bounty - Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts
Thank you for contributing to dimagi/commcare-android!