You are not logged in.
Pages: 1
I'm an avid photographer and I was hoping to organise my now very convoluted photos collection. I'm looking for a program that will go through the files in a certain directory ( recursively ) and place them into a new folder structure organised based on the EXIF data on the file. While most photo organising programs will do this when importing from a camera, I was to do it to my entire photo collection ( ~ 4000 files ) that are currently organised chaotically as I change software and prefered organisation format etc. . Do you know of any software that will do this well? I've tried Darktable and digiKam to no avail.
Offline
A few years ago I wrote a Python 3 script to add the EXIF date to the file name of each photo recursively. The sorted files are copied to the ../sorted folder. You could probably change this script to create folders based on dates or other EXIF information. I would copy some sample photos to a test folder and experiment with the script. Note that it needs the exiv2 package installed.
You run it with:
cd foldername
python mv_exif.py
#!/usr/bin/env python
# rename and copy photos according to their EXIF date order
# needs exiv2
import os, subprocess, shutil
fn = list(os.walk('.'))[0][2]
for f in fn:
if ('.jpg' in f or '.JPG' in f) and f[0] != '.':
cmd = ['exiv2', '-K', 'Exif.Photo.DateTimeOriginal', f]
r = subprocess.check_output(cmd)
r = r.decode("utf-8", "ignore")
r = r[60:].strip().replace(' ', '_')
f2 = "../sorted/" + r + "__" + f
f2 = f2.replace(':', '-')
print (f,f2)
shutil.copyfile(f, f2)
Last edited by Morn (2018-05-06 18:57:46)
Offline
Thank you! I was just looking up how to do this! I think I've tried every program in the repos with the word photo in it at this point!
Offline
Also, I think you have to create the "../sorted" folder yourself first; I am not sure if shutil.copyfile() does it automatically...
Offline
Yeah I'm just using your script as a guide, I'm having too much fun programming again to do anything but overdo it. Also, I like your icon!
Offline
Pages: 1