Just for the fun of it, I've written a toolset for importing and moving files from a digital camera, taking the idea of sorting images based on EXIF data one step further. For images, it tries to parse EXIF meta data, meta data from video files is parsed by getID3() (

General Workflow

Suppose you have taken a pile of photos and videos over the last couple of weeks on your digital camera. You would like to have them stored neatly on your fileserver, using a clean naming scheme of YYYY-MM, based on when the photos have been taken.

The intended workflow is:

  1. Plug in your camera or insert storage card into reader
  2. Import all files to a temporary location
  3. Browse through files, delete unwanted photos
  4. Move files to final destination
  5. Profit!

Other possible actions are:

  • List folders with their sizes from the default mount point
  • Display meta information about image and video files, i.e. EXIF data, AVI or MOV meta data
  • Create an index sheet / contact sheet with thumbnail images (no video files)
  • Duplicate a folder with all files - useful for sorting or backup purposes
  • Strip files from one folder which are present in another folder - e.g. first duplicate a folder, then remove all images and video files from the first folder, then strip all files present in the first folder from the second folder
  • Delete all files and folders from a media source - after importing them of course ;-)

In the end, you'll have your filesystem filling up with folders such as


Files are put in these folders based on the date information from the camera embedded in the file. Folders get created as needed.

Further grouping of image can be reached by appending a label to the folder (2010-08-Venice).


Usage instructions

When ./phototools.php gets called without options, the following output is given:

PhotoTools is a toolset for managing photos and videos from a digital camera
or storage medium.

Copyright (C) 2011 Roland Eckert <>

  This program comes with ABSOLUTELY NO WARRANTY.
  This is free software, and you are welcome to redistribute it
  under certain conditions. See COPYING for details.


  ./phototools.php [COMMAND]... [OPTION]...

  ./phototools.php delete <source> [go]
  ./phototools.php duplicate <source>
  ./phototools.php import <source>
  ./phototools.php index <source>
  ./phototools.php list
  ./phototools.php meta <file>
  ./phototools.php move <source> <target> [go]
  ./phototools.php strip <source> <master> [go]


  list      Lists all available folders from the default mount point (/media/)

  delete    Delete all files from the specified source folder. Dry-run mode (no
            action taken) if "go" isn't added to end of command line

  duplicate Duplicates the given source folder in the same location,
            appending a default extension (_duplicate)

  import    imports all supported file types recursively from the given source
            folder and copies them to the default temp folder (/home/roland/tmp/)
            Supported file types are: avi, cr2, jpg, mov

  index     create contact sheet containing all images as thumbnails

  meta      Read meta data from file, e.g. EXIF data

  move      Moves the images from the specified source folder to the target
            folder, using EXIF, ID3 or file date information for a suitable
            folder name. Dry-run mode (no action taken) if "go" isn't added
            to end of command line

  strip     Removes all files from the given source folder which are present in
            the given master folder. Dry-run mode (no action taken) if "go"
            isn't added to end of command line

Please report bugs to Roland Eckert <>.


Download here: phototools-0.3.2.tgz. The toolset is released under the GPLv3 (


  • 0.3.2: Check for exif extension, colored output, code cleanup
  • 0.3.1: Base path option added. Now callable from everywhere, e.g. symlink in $HOME/bin
  • 0.3: Raw file handling added, duplicate check when importing files improved
  • 0.2: Video type MOV handling added
  • r172: Command [delete] added, bugfixes, code restructured
  • r167: Initial Release
projects/phototools.txt · Last modified: 2018-04-05 17:21 by roland