Skip to content

Commit

Permalink
Merge pull request BMorearty#9 from jgfield/master
Browse files Browse the repository at this point in the history
Deconflict directories/filenames on export
  • Loading branch information
BMorearty committed May 28, 2011
2 parents ee8b137 + 2f01401 commit c351886
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 89 deletions.
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ metadata to the copies.
This script has been tested with iPhoto 8.1.2 (from iLife '09); other versions
may or may not work.

Originally written by Derrick Childers and
Originally written by Derrick Childers and
[posted to macosxhints](http://www.macosxhints.com/article.php?story=20081108132735425).
Modifications by Guillaume Boudreau,
Modifications by Guillaume Boudreau,
[Brian Morearty](http://github.com/BMorearty),
[Mark Nottingham](http://github.com/mnot),
[Duoglas Du](http://github.com/duoglas), and
Expand All @@ -21,14 +21,16 @@ Usage
1. Run this:
python exportiphoto.py [options] <iPhoto Library dir> <destination dir>
Options include:
-a, --albums use albums instead of events
-m, --metadata write metadata to images
-f, --faces store faces as keywords (requires -m)
-q, --quiet use quiet mode
-d, --date stop using date prefix in folder name
-a, --albums use albums instead of events
-m, --metadata write metadata to images
-f, --faces store faces as keywords (requires -m)
-q, --quiet use quiet mode
-d, --date stop using date prefix in folder name
-x, --deconflict deconflict export directories of same name

2. There is no step 2

note that the -m flag is only available if extra libraries are installed;
note that the -m flag is only available if extra libraries are installed;
see below.

if you are facing encoding problems like "UnicodeEncodeError", try -q flag to stop the console output;
Expand All @@ -41,7 +43,7 @@ the -a option on the command line.

It creates a separate folder on disk for each event. Every folder is prefixed
by the event date in this format: yyyy-mm-dd (because this format is sortable by name)
unless you use the -d option.
unless you use the -d option.
If the event has a name it is appended to the end of the folder name.

Example
Expand Down Expand Up @@ -72,7 +74,7 @@ If you set the -d option to turn off the prepended date, the folder names will b
Writing Metadata
----------------

If pyexiv2 is installed, exportiphoto can write iPhoto metadata into
If pyexiv2 is installed, exportiphoto can write iPhoto metadata into
images as they're exported, with the -m option. Currently, it writes:

- iPhoto image name to Iptc.Application2.Headline
Expand All @@ -85,7 +87,7 @@ See below for information on installing pyexiv2.
NOTE: if you see messages like this:

Error: Directory Canon with 1100 entries considered invalid; not read.

you can safely ignore them; they indicate a problem reading the metadata
already in the file. Installing a newer version of pyexiv2 should fix this
(as of this writing, it's fixed in the repository, but not released).
Expand All @@ -100,17 +102,17 @@ to set up:
> sudo port install scons
> sudo port install exiv2
> sudo port install boost +python26
Then, after downloading Pyexiv2 <http://tilloy.net/dev/pyexiv2/> and changing

Then, after downloading Pyexiv2 <http://tilloy.net/dev/pyexiv2/> and changing
into its source directory:

> export CXXFLAGS="-I/opt/local/include"
> export LDFLAGS="-L/opt/local/lib -lpython2.6"
> sudo scons install
> cd /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/
> sudo mv libexiv2python.dylib libexiv2python.so

Note that you'll have to use python2.6 to run the script; e.g.,

> python2.6 exportiphoto ...

Loading

0 comments on commit c351886

Please sign in to comment.