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

ImagePicker loses EXIF when resizing via maxWidth or maxHeight #12921

Closed
romaluca opened this issue Nov 8, 2017 · 10 comments
Closed

ImagePicker loses EXIF when resizing via maxWidth or maxHeight #12921

romaluca opened this issue Nov 8, 2017 · 10 comments
Labels
p: image_picker The Image Picker plugin. package flutter/packages repository. See also p: labels.

Comments

@romaluca
Copy link

romaluca commented Nov 8, 2017

Hi, i'm using the plugin:
https://github.com/flutter/plugins/tree/master/packages/image_picker

for get images and photo. I'm using it also with maxWidth and maxHeight.

Is possible have the exif metadata before the resize?

How can i do it?

Thanks

@roughike
Copy link
Contributor

roughike commented Nov 9, 2017

What info do you specifically need?

There's no currently an API for this, but I'm interested in implementing it.

@romaluca
Copy link
Author

romaluca commented Nov 9, 2017

I need:
Make, Model, FNumber, SpectralSensitivity, ExposureTime, FocalLength, GPSLatitude, GPSLongitude

I also wrote this flutter plugin:

https://github.com/romaluca/exif_flutter

(it is a bad port of this: https://pub.dartlang.org/packages/exifdart )

It works but only when i don't specify maxHeight or maxWidth in image picker

@roughike
Copy link
Contributor

roughike commented Nov 9, 2017

Ah, I see.

The EXIF data is lost since when you use maxWidth or maxHeight, a scaled version of the image is created and saved on the filesystem. This is so that we don't actually downscale the original picture in the users gallery, which might result in angry users.

So, in the case of maxWidth or maxHeight being used, the EXIF data should be copied from the original image to the scaled one.

This needs a new version of the image_picker plugin.

@sethladd sethladd changed the title ImagePicker get exif metadata ImagePicker loses EXIF when resizing via maxWidth or maxHeight Jan 22, 2018
@zoechi zoechi added this to the Goals milestone Oct 28, 2018
@ko2ic
Copy link

ko2ic commented Nov 1, 2018

I fixed it. flutter/plugins#866

Please check if I am fixing what you are imagining.

@eseidelGoogle
Copy link
Contributor

I've written notes about how to add exif on iOS/Android to: #10533 (comment) . I suspect all of these exif bugs are the same root cause and easy to fix.

@btastic
Copy link

btastic commented Dec 13, 2018

I am experiencing the same issue after resizing the image on android, exif data is lost (can confirm it atleast for orientation). Any news on this?

@lifenautjoe
Copy link

Still experiencing this issue with image_picker: 0.5.0+3

@cyanglaz
Copy link
Contributor

I'm fixing this in flutter/plugins#1586
I will create a separate PR to copy GPS data after this PR is merged in

@cyanglaz
Copy link
Contributor

flutter/plugins#1586 is merged, you can use the latest version. Image picked now has the EXIF data copied from the original photo.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p: image_picker The Image Picker plugin. package flutter/packages repository. See also p: labels.
Projects
None yet
Development

No branches or pull requests

9 participants