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

EXIF Data Loss When Picking Image from Gallery (Android) #1629

Open
asiteandroid opened this issue Nov 14, 2024 · 8 comments
Open

EXIF Data Loss When Picking Image from Gallery (Android) #1629

asiteandroid opened this issue Nov 14, 2024 · 8 comments
Labels
new issue An issue that hasn't yet been seen from the maintainer stale

Comments

@asiteandroid
Copy link

asiteandroid commented Nov 14, 2024

Description:

When selecting an image from the gallery using the file_picker package version 8.1.4 on Android, the EXIF metadata (e.g., orientation, timestamp, location data) is lost in the returned image file. This issue appears to occur only on Android devices.

Platform Android

Steps to Reproduce:

Pick an image from the gallery on an Android device.
Check the EXIF data of the selected image before and after picking it.
The EXIF metadata (such as orientation, timestamp, and location) is lost after selection.

Code:

FilePickerResult? result = await FilePicker.platform.pickFiles(type: FileType.image, allowMultiple: true, compressionQuality: 0)

Expected Behavior: The EXIF data should remain intact after selecting the image from the gallery.

Actual Behavior: EXIF data is lost or stripped from the image

Ref Link: https://developer.android.com/training/data-storage/shared/media#location-info-photos

@asiteandroid asiteandroid added the new issue An issue that hasn't yet been seen from the maintainer label Nov 14, 2024
Copy link

This issue is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Nov 22, 2024
@asiteandroid
Copy link
Author

Do you have any updates on this?

@github-actions github-actions bot removed the stale label Nov 27, 2024
Copy link

github-actions bot commented Dec 5, 2024

This issue is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Dec 5, 2024
@asiteandroid
Copy link
Author

Hello, Are there any updates on this? We are still waiting for a response.

@sjcons
Copy link

sjcons commented Dec 18, 2024

I have tested packages file_picker and image_picker with exif and the Exif data was removed from all picked images.

In one example, the image size in Gallery is 1.93MB vs 341K for the file returned by image_picker. The max width and height were not specified so it should have returned the original size according to its documentation. When I used file_picker, all images were compressed as well.

I know the code is working since I used image_picker to pick from the camera and the file returned had complete Exif data except I did not see location details. The file was not compressed.

My question is who is compressing the image?

@sjcons
Copy link

sjcons commented Dec 20, 2024

Update from my previous post after testing further:

  1. Using File-Picker, picking from the Gallery, the image is always compressed and copied to the App Cache with no Exif.
  2. Image-Picker initially shows "Recent" images first. I believe they are cached and compressed (maybe by the system). When picked, they are saved as compressed in the App Cache and have no Exif.
  3. Image-Picker when selecting "Browse" on the menu, picks from the original images and saves as full size in the App Cache with Exif.

Further:

  • File Picker always renames the file with the current date, so no way I can see to get any details on the image.
  • Image picker when returning a "Recent" image, it has a name like "1000000888.jpg" so no way to get information either.
  • Image picker when picking from the Gallery, appears to have the original name with the date and time it was taken along with Exif as well.

Another option I'm considering is to use SAF_Util which can pick files and returns the full path, then use SAF_Stream to cache or read them. If just viewing images, this might be the most efficient as I don't think they are cached. However, permissions might be an issue.

@Arcturus5404
Copy link

We are experiencing the same issue.

It seems that when we switch to type media the issue does not occur.

Copy link

This issue is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new issue An issue that hasn't yet been seen from the maintainer stale
Projects
None yet
Development

No branches or pull requests

3 participants