Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.
/ exifsort Public archive
forked from timrc/exifsort

Bash script to sort photos based on exif data. Deprecated in favor of https://github.com/dtrejod/goexif

Notifications You must be signed in to change notification settings

dtrejod/exifsort

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

exifsort

The following script was written in bash on Ubuntu Linux and automatically sorts your images into directories based on the date and time the photo was taken. How does it do this? By making use of the EXIF data your digital camera stores inside the image. The date and time the photo was taken is stored in that EXIF data. When an image doesn't have EXIF data (such as when it was downloaded from the Internet, or taken from a camera that doesn't support adding EXIF data), it will use the files last-modified time.

First, this should be run in the top-most directory of wherever your pictures are stored. If you have pictures/foldername/somepics/ and pictures/anotherfolder/morepics, run it from your pictures/ directory.

This script requires ImageMagick.

There are quite a few opportunities to improve this script -- and some cautionary notes as well -- marked within the script with FIXME tags. This script should be considered unmaintained, and I generally won't be updating it with any major changes, though pull requests are welcome.

Usage: Copy the script into a file, editing options where appropriate, and save it. Make it executable and run it from the command line or window, from the directory where your pictures are stored. No command-line arguments. Back up your stuff first :)

exiftool

Many folks have mentioned that exiftool is a much faster and cleaner way of what this script works to accomplish.

If you have exiftool installed, the following command will sort your files from $DIR to their own folders, sorted by date information from the exif data:

exiftool "-Directory<DateTimeOriginal" -d "%Y/%Y-%m-%d" $DIR

More information is here: https://sno.phy.queensu.ca/~phil/exiftool/#filename

Systemd

Included are systemd unit files to run the exifsort tool periodically. To use the included systemd unit:

  1. Copy exifsort.sh script to your pictures directory.
$ cp exifsort.sh ~/pictures
  1. Copy exifsort@.timer and exifsort@.service to your user systemd unit directory.
$ cp exifsort\@* ~/.config/systemd/system
  1. Reload the systemd daemon.
$ systemctl daemon-reload --user
  1. Start the systemd unit timer
systemctl --user start exifsort@$(systemd-escape ~/pictures).timer

About

Bash script to sort photos based on exif data. Deprecated in favor of https://github.com/dtrejod/goexif

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%