native_exif icon indicating copy to clipboard operation
native_exif copied to clipboard

Exif atributes only change in android emulator.

Open Hash1mot0 opened this issue 2 years ago • 1 comments

Hello, I'm having a problem where the image exif attributes only change in android emulator, but when I'm trying in a real smartphone (S20fe) the exif does not change or update.

Heres the code part:

final exif = await Exif.fromPath(imagefile); debugPrint('Image file has been loaded');

final attributes = await exif.getAttributes();

await exif.writeAttribute('DateTimeOriginal', videoDate!);

if(location!=null) { await exif.writeAttributes({ 'GPSLatitude': lat, 'GPSLatitudeRef': latRef, 'GPSLongitude': lon, 'GPSLongitudeRef': lonRef, }); }

debugPrint('Date time altered to:'); debugPrint(videoDate.toString());

debugPrint('Location altered to:'); debugPrint('$lat$latRef $lon$lonRef');

final result = await exif.writeAttributes(attributes!); await exif.close();

debugPrint('Image attributes has been set');

Hash1mot0 avatar Jan 05 '23 13:01 Hash1mot0

Hi,

we can't reproduce this behavior.

We think all data gets reset at

final result = await exif.writeAttributes(attributes!);

if attributes already includes DateTimeOriginal, GPSLatitude, GPSLatitudeRef, GPSLongitude and GPSLongitudeRef.

That may be your issue here.

The example app now also includes a Update, store and reload attributes button. It updates some attributes, copies the image to a new temporary file and loads it's EXIF data. Please click this button and check the debug prints to verify if attributes are not updated on a real device. If so, please post the results here.

Thanks.

d-kuen avatar Feb 25 '23 13:02 d-kuen