Thanks for creating this script. It is a huge help! However I get the following error:
D:\Backups\GoogleFotosTakeoutLine301120\Takeout\GoogleFotos/1980-01-01/1988 Ferie 09.jpg
Error setting creation date from string:
time data '2007:12:28 14:31: 2' does not match format '%Y:%m:%d %H:%M:%S'
Traceback (most recent call last):
File "c:\users\emil\anaconda3\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "c:\users\emil\anaconda3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Emil\anaconda3\Scripts\google-photos-takeout-helper.exe_main.py", line 7, in
File "c:\users\emil\anaconda3\lib\site-packages\google_photos_takeout_helper_main.py", line 356, in main
filter_fun=lambda f: (is_photo(f) or is_video(f))
File "c:\users\emil\anaconda3\lib\site-packages\google_photos_takeout_helper_main_.py", line 99, in for_all_files_recursive
for_all_files_recursive(file, file_function, folder_function, filter_fun)
File "c:\users\emil\anaconda3\lib\site-packages\google_photos_takeout_helper_main_.py", line 102, in for_all_files_recursive
file_function(dir, file)
File "c:\users\emil\anaconda3\lib\site-packages\google_photos_takeout_helper_main_.py", line 274, in fix_metadata
set_creation_date_from_exif(file)
File "c:\users\emil\anaconda3\lib\site-packages\google_photos_takeout_helper_main_.py", line 241, in set_creation_date_from_exif
set_creation_date_from_str(file, datetime_str)
File "c:\users\emil\anaconda3\lib\site-packages\google_photos_takeout_helper_main_.py", line 226, in set_creation_date_from_str
_os.utime(file, (timestamp, timestamp))
UnboundLocalError: local variable 'timestamp' referenced before assignment
I seem to get this error when the script tries to process photos that I have manually uploaded to Gphotos, rather than those uploaded by my phone automatically. I should mention that i use the --divide-to-dates tag.
Is it possible to include an ignore-errors flag that simply skips photos with incorrect date strings? Alternatively, puts the photos into a non-sorted folder?