commcare-android icon indicating copy to clipboard operation
commcare-android copied to clipboard

Respect image orientation during resizing

Open ctsims opened this issue 1 year ago • 3 comments

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.

  1. Create a CCHQ app that captures images.
  2. 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.
  3. Install the app on an Android device
  4. When you get to a screen with an image capture question, capture the photo by choosing the above photo you clicked from your phone.
  5. After form submission, navigate to Submit History report on HQ and download the attachment
    • Check the resized image’s EXIF orientation data
  6. 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

ctsims avatar Feb 15 '24 17:02 ctsims

Other EXIF respect use case: https://github.com/dimagi/commcare-android/issues/2689

ctsims avatar Feb 15 '24 17:02 ctsims

/bounty $150

kiran-tripathy avatar Sep 17 '24 17:09 kiran-tripathy

💎 $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

  1. Make sure that you meet the eligibility criteria and have fulfilled all the requirements
  2. 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

  1. Start working: Comment /attempt #2743 with your implementation plan
  2. Submit work: Create a pull request including /claim #2743 in the PR body to claim the bounty
  3. 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!

Add a bountyShare on socials

algora-pbc[bot] avatar Sep 17 '24 17:09 algora-pbc[bot]