Android: Fix photo sorting in gallery

I had to restore my wife's smart phone files from a manual backup after the upgrade from LineageOS 16 to 20 failed. After restoration, all images in the gallery were grouped into the same date - there was no order whatsoever.

Simple Gallery Pro sorts and groups images by their file modification date, not by their EXIF date. Because I restored all 9.000 files on the same day, they had the same modification date and thus were grouped into the same day :(

I made the backup with adb pull /sdcard, which copied all files from the smartphone onto my PC. This command already dropped the original modification dates; the better backup command would have been

adb pull -a /sdcard

- that one preserves the file timestamps.

Fixing timestamps

At first I looked for a solution to extract timestamps from the photo's EXIF data and change the file's creation timestamp.

Then I learned that images and videos received by WhatsApp have no exif data, but have filenames that include the timestamp. Those files need also be processed.

In the end I installed Image & Video Date Fixer by JD Apps, which fixes timestamps by extracting dates from EXIF data and file names. The free version only fixes 50 files, but the premium one could fix all files in all folders in one go.

Written by Christian Weiske.

Comments? Please send an e-mail.