Skip to main content

By Name scanned photos for Google Photos

Google Photos shows photos in order from newest to oldest, and shows albums in order from newest to oldest according to the newest photo included in each album; but scanned photos don't record when the original photo was taken.

When scanned photos are already organized into a sequence using the photo filenames, we can quickly encode that sequence as dates and times — but then we lose the opportunity of recording the actual dates and times the photos were taken.

These details are for Microsoft Windows, the details will be slightly different for other computers.

The Tools:

  1. Command Prompt
  2. Text Editor — something as-simple-as Notepad
  3. Spreadsheet — something as-simple-as LibreOffice Calc
  4. ExifTool — download this powerful photo software

The Steps:

  1. Make working copies of some photo files
  2. Make a list of the names of those photo files
  3. Add a column of ordered dates and times to the list
  4. Add the dates and times from the list to the photo files
  5. Upload the photo files to Google Photos

The Steps in laborious detail:

  1. Make working copies of some photo files

  • Make a working folder on your computer.
  • Copy some photo files you want to change into the working folder.
  1. Make a list of the names of those photo files

  • Open a command prompt.
  • Change directory at the command prompt to your working folder.
  • Use the following dir command, at the command prompt, to make a text file that contains the photo filenames line-by-line —
    dir /b /o-n > photo-datetime-changes-new.csv
    
  • Open the file photo-datetime-changes-new.csv in Notepad, look at the list you made and notice the filenames are in reverse order —
    photo-datetime-changes-new.csv
    20170521-121-1.jpg
    20170521-094-103-2.jpg
    20170521-094-103-1.jpg
    20170521-066-6.jpg
    20170521-066-3.jpg
    20170521-060-6.jpg
    20170521-060-3.jpg
    20170521-054-7.jpg
    20170521-054-3.jpg
    20170521-054-1.jpg
    20170521-046-7.jpg
    20170521-046-4.jpg
    20170521-042-6.jpg
    20170521-042-4.jpg
    20170521-042-3.jpg
    
  • Alternatively, use the following dir command —
    dir /b > photo-datetime-changes-new.csv
    
  • Alternatively, re-arrange the filenames into whatever order you would like —
    photo-datetime-changes-new.csv
    20170521-094-103-1.jpg
    20170521-094-103-2.jpg
    20170521-121-1.jpg
    20170521-054-3.jpg
    20170521-054-7.jpg
    20170521-060-3.jpg
    20170521-042-3.jpg
    20170521-042-4.jpg
    20170521-042-6.jpg
    20170521-046-4.jpg
    20170521-046-7.jpg
    20170521-054-1.jpg
    20170521-060-6.jpg
    20170521-066-3.jpg
    20170521-066-6.jpg
    
  • Remove any lines that are not photo files:
    20170521-094-103-1.jpg
    20170521-094-103-2.jpg
    20170521-121-1.jpg
    20170521-054-3.jpg
    20170521-054-7.jpg
    20170521-060-3.jpg
    20170521-042-3.jpg
    20170521-042-4.jpg
    20170521-042-6.jpg
    20170521-046-4.jpg
    20170521-046-7.jpg
    20170521-054-1.jpg
    20170521-060-6.jpg
    20170521-066-3.jpg
    20170521-066-6.jpg
    
  • Use the Notepad File/Save menu item to save the list you've made.
  • Close Notepad.
  1. Add a column of ordered dates and times to the list

  • Open the file photo-datetime-changes-new.csv in a spreadsheet.

  • Choose what will be the newest date in the sequence
    =DATEVALUE("12/31/1956 12:00:00 PM")
    
  • Format column B cells to show YYYY:MM:DD HH:MM:SS

  • Set a cell formula to generate older date time values

    jump back 6 hours (quarter of a day) each time

    =B1-0.25
    

    or if more than 1300 photo files for that year

    =B1-0.125
    

    or if more than 2700 photo files for that year

    =B1-0.0125
    
  • Drag-down the formula to generate older dates and times, one for every photo filename

  • Use the spreadsheet File/Save As… menu item to save the list with format as Text CSV .csv.
  • Use the spreadsheet File/Exit menu item
  • Open the file photo-datetime-changes-new.csv in Notepad
  • Add a line at-the-top showing the required column headings:
    SourceFile,DateTimeOriginal
    20170521-094-103-1.jpg,1956:12:31 00:00:00
    20170521-094-103-2.jpg,1956:12:30 18:00:00
    20170521-121-1.jpg,1956:12:30 12:00:00
    20170521-054-3.jpg,1956:12:30 06:00:00
    20170521-054-7.jpg,1956:12:30 00:00:00
    20170521-060-3.jpg,1956:12:29 18:00:00
    20170521-042-3.jpg,1956:12:29 12:00:00
    20170521-042-4.jpg,1956:12:29 06:00:00
    20170521-042-6.jpg,1956:12:29 00:00:00
    20170521-046-4.jpg,1956:12:28 18:00:00
    20170521-046-7.jpg,1956:12:28 12:00:00
    20170521-054-1.jpg,1956:12:28 06:00:00
    20170521-060-6.jpg,1956:12:28 00:00:00
    20170521-066-3.jpg,1956:12:27 18:00:00
    20170521-066-6.jpg,1956:12:27 12:00:00
    
  • Use the Notepad File/Save menu item to save the changes you've made.
  • Close Notepad.
  1. Add the dates and times from the list to the photo files

  • Open a command prompt.
  • Change directory at the command prompt to your working folder.
  • Use the following ExifTool command, at the command prompt, to change the "Date taken" of each photo file to match the corresponding date and time you listed in photo-datetime-changes-new.csv
    exiftool -overwrite_original -csv=photo-datetime-changes-new.csv .
    
    Warning: [minor] Possibly incorrect maker notes offsets (fix by 4186?) - ./20170521-042-4.jpg
        1 directories scanned
       15 image files updated
    
  • Check that the Microsoft Windows property "Date taken" now shows the dates and times you wanted, for those photo files.
  1. Upload the photo files to Google Photos

  • If the photo files had been uploaded before making these changes, then it may be better to delete them from Google Photos before uploading these changed files: to avoid duplicates.
  • Upload the photo files to Google Photos
  • Delete the working copies of the photo files from your working folder

Summary:

At-the-cost of no-longer being able to record the actual dates and times that photos were taken, we can use dates and times to encode an existing sequence based-on-filenames or an arbitrary sequence created by re-arranging a list of filenames.

Google Photos will simply show the photos in order from newest to oldest date-and-time.