I want to be able to control the order of the images that are displayed in a Photo Album. I do not want them to be displayed vertically as well. The use-case is to upload scanned images one by one and have them show in that order such that the person viewing the album can look at them in that same order. Is there a way to do that?
One way would be to rename all your images in such a way that your desired order would match with lexicographical order of modification stamps on the filesystem when uploading from the host to the Google Photos as most of the Google products obey such sorting by default.
Unfortunately, we had thought that @user0's answer in https://webapps.stackexchange.com/a/130189/14529 was sufficient. But I tried using that approach again and found it did not work. I speculate that at one time it did actually work, because I tested it out, but as of 2018-08-26, it does not affect the ordering.
So, from further experimentation, I determined that the GPS date/time stamp EXIF tags in the image files are what Google Photos seems to use for sorting the images in the album, and seems to ignore the modification or creation date EXIF tags.
So in order to fix this, in Ubuntu, I used the
exiftool (you can install it via
sudo apt install exiftool) in the following script (explanation follows afterwards):
#!/bin/bash in_dir=/path/to/your/directory/full/of/image/files/with/EXIF/tags t0=$(date +"%s") find $in_dir -type f | sort -r -n | while read file do echo "Processing $file ..." # Get the date/time stamp for the -AllDates option: t0_datetime=$(date -d "@$t0" +"%Y-%m-%d %H:%M:%S") # Get the date/time stamps for the -GPSDateStamp and -GPSTimeStamp options: t0_date=$(date -d "@$t0" +"%Y-%m-%d") t0_time=$(date -d "@$t0" +"%H:%M:%S") # Modify the EXIF tags for those dates, making them all the same: # # It is not understood why -AllDates doesn't also modify the GPS date/time stamps. # exiftool -AllDates="$t0_datetime" -GPSDateStamp="$t0_date" -GPSTimeStamp="$t0_time" -overwrite_original $file # Modify the filesystem date/time stamps: # # This is likely not really necessary but do it anyhow for consistency when examining the file listing on Linux: # touch -d "@$t0" "$file" # Go in reverse, by bumping back by a minute: ((t0 = t0 - 60)) done
What this script does: Find all of the image files (which should have names that sort lexicographically such as having page numbers of 001, 002, etc), sort them in reverse numerical order for those page numbers (
sort -r -n), and calls the
exiftool on each one to set the date/time stamp EXIF tags. Each date/time stamp is separated by 60s (1 min), and I've not experimented with other time deltas to see if it matters. For my purposes of forcing Google Photos to sort them in order, the particular date doesn't matter, so I started with the current date and work backwards.