[ANN] organize tool
'organize' is a command-line tool that creates organized directories of photos and other media files. Photos can be easily organized by metadata into a directory structure of your choosing. It is built on Exiv2 and currently supports a fairly wide selection of exif, iptc, and file metadata (xmp could be added if there is demand).
I created this tool after looking around for an existing solution and finding no great options. My own personal photo library had become a jumble of 15,000+ files in a hodge-podge directory structure. With this new tool I ran the following:
organize /var/photos /var/photos2 @year-@month/@day
And a few minutes later had an organized library with photos and videos grouped first by year-month and then by day of the month (with duplicates filtered out). On windows it would be very similar:
organize c:\users\public\pictures c:\users\public\pictures2 @year-@month\@day
There are currently no prepackaged binaries, but I will try to get some uploaded soon. The tool is fairly easy to build on Windows and Unix like systems. It builds separately from the rest of Exiv2 because it has an extra dependency on the C++ boost library. To build the tool, first make sure you have boost installed, then build exiv2, and then build the organize tool. On Windows there is a project file in exiv2\msvc\organize, and for Unix systems there is a makefile in exiv2\contrib\organize (in both cases you may need to tweak the include and lib dirs to point to boost on your system).
Below is the tool's help output to give you a better idea of what is does. Let me know if you find is useful or have suggestions.
Usage: organize [options] source-dir dest-dir pattern Creates groups of files in new directories defined by a metadata 'pattern'. Files are copied, moved, or linked from 'source-dir' to 'dest-dir'. The destination directory should not be within the source directory. Options: -m [ --move ] move files rather than copy -s [ --symlink ] symlink files rather than copy (posix only) -o [ --order ] arg order and types of metadata to read e=exif, i=iptc, f=file (default: eif) -u [ --unsorted ] arg special directory to store unsorted files (default: unsorted) -d [ --dups ] arg special directory to store files with duplicate names (default: duplicates) -f [ --force ] overwrite duplicate files instead of using special directory -r [ --rename ] rename duplicate files instead of using special directory -i [ --ignore ] ignore both unsorted and duplicate files instead of using special directories --ignore-unsorted ignore unsorted files instead of using special directory --ignore-dups ignore duplicate files instead of using special directory --verify verify copied or moved files and exit if incorrect -x [ --exclude ] arg exclude directories and files that contain arg (case sensitive on all platforms) -l [ --limit-depth ] arg limit recursion to specified depth (0 disables recursion) -v [ --verbose ] prints operations as they happen -n [ --dry-run ] do not make actual changes (implies verbose) -h [ --help ] show this help message then exit -V [ --version ] show program version then exit Pattern values: @date date captured (2009-01-19) @year year captured (2009) @month month captured (01) @day day captured (19) @time time captured (14-35-27) @hour hour captured (14) @min minute captured (35) @sec second captured (27) @dim pixel dimension (2272-1704) @x pixel width (2272) @y pixel height (1704) @make device make (Canon) @model device model (Canon PowerShot S40) @speed shutter speed (1-60) @aper aperture (F3.2) @iso iso speed (400) @focal focal length (8.6 mm) @dist subject distance (1.03 m) @meter meter mode (multi-segment) @macro macro mode (Off) @orient orientation (top_left) @lens lens name (Tamron 90mm f-2.8) @key first keyword (Family) Examples: `organize -m mess clean @year-@month' Moves files from 'mess' into directories of 'clean' according to year-month the file was captured (clean/2006-11/...) `organize -o ie source find width-@x/height-@y' Copies files into directories according first to pixel width then pixel height. Check iptc then exif metadata (find/width-2272/height-1704/...) `organize -lf source find @aper/@hour' Force create symlinks in directories according first to aperture then hour captured (find/F3.2/15/...)
Edit: Updated to latest --help output
RE: [ANN] organize tool - Added by Anonymous over 10 years ago
This is a very useful tool which meets a real need. Congratulations to Brad for this achievement.
Brad and I have collaborated to improve the exiv2/msvc build machinery. A new solution exiv2+organize.sln has been added to enable organize.exe to be build at the same time as building the rest of the exiv2 family of DLLs, static and dynamic libraries. The existing solution exiv2.sln is unchanged.
The details of how to build exiv2 (with or without organize) are explained in exiv2/msvc/README-MSVC.txt
RE: [ANN] organize tool - Added by Anonymous over 10 years ago
It's very excellent tool! I love it.
With this tool, I can rearrange my photos by many perspective.
Just one point, I hope adding @lensname pattern value.
Anyway, thank you for your good job!
RE: [ANN] organize tool - Added by Brad Schick over 10 years ago
Thanks, glad you like the tool. I just committed code that adds the following additional metadata values:
@macro macro mode (Off) @orient orientation (top_left) @lens lens name (Tamron 90mm f-2.8)
This was an easy change thanks to new code Andreas added to the exiv2 library. If anyone needs them, the following would be easy for me to add as well:
flashBias, exposureMode, sceneMode, imageQuality, and whiteBalance
RE: [ANN] organize tool - Added by Brad Schick about 10 years ago
A few people have written emails asking for a Windows binary. I've attached that to this post. Just unzip and run, no installation required.
RE: [ANN] organize tool - Added by Andreas Huggel about 10 years ago
Thanks. I do plan to include the organize binary in the Windows package, once I get it to cross-compile on Linux with the build script that I use for the Windows package...
RE: [ANN] organize tool - Added by Arjh Smith over 9 years ago
Would you be able to add the "Comment" field from EXIF that is customized from the camera directly ?
When you have multiple people using the same camera models. This is a great field to plug in some specific info about the shooter... either their initials or the Short Event Name.. things can really be automated by using that field.
Along with that I have a need to use the Shutter Count and Serial Number fields to Rename the files.
Do you think it would be possible to rename based on these fields ? This way I could have Folders based on the Camera Model_Serial Number and everything from them would be stored there permanently.
RE: [ANN] organize tool - Added by Anchal Nigam about 6 years ago
This sounds awesome. Two questions:
- Where do I download it from?
- How are you checking for duplicates?
RE: [ANN] organize tool - Added by Robin Mills almost 6 years ago
This code is in our tar-ball (and on the trunk) in the directory contrib/organize. A Makefile is provided. You can also build with Visual Studio using the solution msvc/exiv2+organize.sln and this is documented in msvc/README-MSVC.txt. This code is a contribution and not routinely built and tested by the Exiv2 team.
I've never studied the organize code, so I cannot answer specific questions. I have quickly looked at variable 'dups' in contrib/organize/organize.cpp. I think duplicates are files with identical names (eg IMG_1234.JPG) in different directories. When you have the code built, I'm sure you can run this on a safe copy of your photos and find out. When you do, please update this thread to share your discoveries with the community.