• Français
  • English

exif_rename_files

Renames or copies JPEG files according to Exif data embedded in them

Introduction

This python utility allows management of pictures coming from many devices, with variable naming schemes (DSC0000.JPG, IMG0008.JPG, IMG_20150322_135126.JPG, ...), and to regroup them into a coherent whole; typical use case is to clean up files after a holiday where many people took pictures.

Requirements

Developed under GNU/Linux, this script should work under any platform supporting Python; it has been tested under Windows and Mac OS X.

Download

Usage examples

python exif_rename_files.py /home/miguel/photo/DSC0000.JPG
Copy the image directly in the folder where it is located:
python exif_rename_files.py /home/miguel/photo/
Copy all the images directly in the folder where they are located
python exif_rename_files.py --output-directory /home/miguel/photo/output/2013/ /home/miguel/photo/2013/ /home/pauline/photo/2013/
Copy the images coming from two directories, in a target directory
python exif_rename_files.py --no-clobber --recursive --output-directory /home/miguel/output /home/miguel/photo
Copy the all the images in the input directory, including those in subfolders, in the target directory, but do not overwrite is there is already an image with the target file name
find /home/miguel/photo/ -iname "DSC*" -exec exif_rename_files.py --move {} +
Use find to fetch all the file name starting with “DSC” or “dsc” and rename them

Manual

In a general way, this application should be called in command line like this:

python exif_rename_files.py [OPTIONS] INPUT

where INPUT is the JPEG file(s) (or directory(ies) containing them) that will be searched and OPTIONS, the options as described below.

Option summary
Option Description
-h, --helpShow help message and exit
-o DIRECTORY, --output-directory=DIRECTORYDirectory where the image files will be written
-t, --dry-runExecute the program, but do not move or copy the files
-C, --copy-directory-treeCopy the directory tree in the output directory, to mimic the input sub-directories
-m, --moveMove the files, instead of copying
-n, --no-clobberDo not overwrite an existing file
-r, --recursiveLook for files in the directory and its subfolders
-v, --verboseExplain what is being done
-N, --include-file-with-no-exifCopy or move files with no EXIF, using their original file name as destination
-V, --versionOutput version information and exit

Bugs

For any bug report, please contact exif.miguel@ptaff.ca

Author

Miguel Tremblay

See also

Project's GitLab page

License

Copyright © 2016 Miguel Tremblay.

exif_rename_files is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.


exif_rename_files

Creation : July 1st, 2016
Villeray
N 45° 33′ W 73° 36′

exif_rename_files

Last update : July 1st, 2016,
Villeray,
N 45° 33′ W 73° 36′