Git Product home page Git Product logo

exportiphoto's Introduction

exportiphoto

Exports an iPhoto library to a folder structure, optionally writing 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 posted to macosxhints. Modifications by Guillaume Boudreau, Brian Morearty, and Mark Nottingham, Duoglas Du.

Usage

  1. Run this: python exportiphoto.py [options] 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 use date prefix in folder name
  2. There is no step 2

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;

Output

By default, exportiphoto exports Events. It can export Albums instead; use 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). If the event has a name it is appended to the end of the folder name.

Example

Let's say you have the following events in iPhoto--two unnamed and one named:

Jun 10, 2009
Charlie's Birthday Party
Jun 20, 2009

Run:

python exportiphoto.py ~/Pictures/iPhoto\ Library/ ~/iPhoto\ Export

If Charlie's birthday party was on June 15th, the output folders will be:

2009-06-10
2009-06-15 Charlie's Birthday Party
2009-06-20

If you set useDate to False by use -d option , the folder names will be:

Jun 10, 2009
Charlie's Birthday Party
Jun 20, 2009

Writing Metadata

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
  • iPhoto description to Iptc.Application2.Caption
  • iPhoto keywords to Iptc.Application2.Keywords
  • iPhoto rating to Xmp.xmp.Rating

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).

Installing pyexiv2

Unfortunately, there is no easy way to install pyexiv2, but if you have MacPorts http://macports.org/, it's relatively simple; follow these steps 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 into its source directory:

> sudo CXXFLAGS=-I"/opt/local/include" LDFLAGS="-L/opt/local/lib -lpython2.6" 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 ...

exportiphoto's People

Contributors

mnot avatar duoglas avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.