k3b / APhotoManager

Manage local photos on Android: gallery, geotag with photomap, privacy, tags, find, sort, view, copy, send, ... .
GNU General Public License v3.0
224 stars 57 forks source link

wrong datetaken after editing EXIF data #149

Open supercub opened 4 years ago

supercub commented 4 years ago

Describe the bug After editing some EXIF data of a picture, e.g. rate the picture (5 star rating) i noticed, that after returning to thumbnail overview page, it's sorting position has changed. Sorting of the thumbs seems to be ordered by property 'datetaken'. So i examined this property before and after entering a picture rating into EXIF data.

Before editing it is:

After editing EXIF data it is:

Please also check attached screenshots.

To Reproduce Steps to reproduce the behavior:

  1. Go to detail view of a picture.
  2. Click on 'more' icon in toolbar.
  3. Choose 'more' in menu.
  4. Choose 'Details' in menu.
  5. scroll down and note property 'datetaken'.
  6. Click 'OK'
  7. Click on pencil in toolbar.
  8. Click on a star in the rating field.
  9. Click on the OK hook in toolbar.
  10. Repeat from step 2 to check property 'datetaken' again,

Expected behavior Editing EXIF data does not change property 'datetaken' and hence does not change sorting of thumbs.

Smartphone (please complete the following information):

Additional context My photos are stored in internal storage, as editing EXIF data on photos stored in external storage (sd-card) didn't work at all for me. The configured timezone on my smartphone is UTC +0200, which might have something in common with the bug adding two hours to 'datetaken' property?

Screenshot before editing EXIF data: Screenshot_20191006-110836_A Photo Manager

Screenshot after editing EXIF data: Screenshot_20191006-111122_A Photo Manager

k3b commented 4 years ago

Since i donot have the photo where this happens i cannot locally reproduceI this behaviour.

I see two possible reasons:

The android-build-in mediascanner (or the app that added the exif to the medai-database) on your device interprets date different than apm-own-media scanner.

If the photo does not contain the information "DateTaken" in the exif-info then the info is infered from other fields

| DateTimeTaken | XMP-exif.DateTimeOriginal | photoshop.DateCreated | XMP-xmp.CreateDate |

(see supported photo properties (exif,xmp,iptc))

if you scroll down the info dialog in the screenshot you can see the different values in different formats/sources:

media-database (your screenshot) exif/iptc/xmp.

What makes me curious: how can you edit a picture without modifying the "date modified" field ? it is the same on both screenshots

supercub commented 4 years ago

Hi k3b, thanks for sharing your thoughts about this. Well i'm not an exif expert, all i have for 'debugging' this is this exiftool to read out the metadata from my photos. I'm not doing any fancy things, just take the pictures with my stock Samsung A5 smartphone cam app and watch them in apm. So if the "date modified" field doesn't change when i edit the photo metadata with apm, there's nothing i can do about it. The remarkable thing about the datetaken issue is, that it's apm itself which shows up a different date before and after editing metadata with apm. So i wonder how can the cause of this issue be outside of apm? Concerning the date fields, exfitool output of the photo does not differ before and after editing metadata with apm, as it does not show any 'date taken' parameter at all. Obviously the value of the 'Rating' field does differ, as this one had been edited. exiftool has some date fields labeled 'Date/Time Original' and 'Create Date', but their values are unchanged after editing. So yes, apm does infer it's 'date taken' property from different metadata fields. Looking at the metadata output of apm, the photo has no XMP or IPTC tags, but 'EXIF.EXIF.DateTimeOriginal', which also stays the same after editing metadata with apm.

In this case to me it looks like the 'datetaken' parameter and it's value, which in apm can be used for sorting photos, is a complete apm 'thing'. apm infers it's value from some metadata and stores it in the picture. And unfortunately somehow it changes it's self generated value of datetaken when editing metadata of the photo.