NAME
zophImport - Import images into zoph
SYNTAX
zophImport [--help] [--album "album"] [--category "category [,
category]"] [--photographer "first_name last_name"] [--people
"first_name last_name [, first_name last_name]"] [--location
["place_title"] [--field name="value"] [--path path] [--datedDirs]
[--update] [--updateSize] [--updateExif] [--nothumbnails] [--verbose]
[--copy] --useIds id ... | image ...
DESCRIPTION
zophImport is the command line importer for the zoph (Zoph Organizes
PHotos) web photo management system.
Any fields specified will be applied to every photo imported. Any
albums, categories, people or places referred to must already be
present in the database.
Imported photos are physically moved away from their current location
and stored in in a directory below IMAGE_DIR - dependent on path,
--dateddirs and --hierarchical settings. The MySQL database stores all
the attributes and references to the images.
Photos can appear in multiple albums and categories, and multiple
people can be in a photo. To handle this, you can either pass a comma
separated list or set the flag multiple times. Actually, you can use a
comma separated list for categories and people but not for albums
(since I realized that I have many albums with commas in their names
and have yet to build an escape mechanism). If multiple people appear
in a photo, specify them in left to right, front to back order.
OPTIONS
The ‘"’ around arguments are needed to prevent breaking up around
whitespace or the shell interpreting special characters. If an album
name consist of a single word you can omit them.
--help
lists all supported options and quits
--album "album"
put the references to the image(s) into album(s)
--category "category [, category]"
put the references to the image(s) into category(s)
--photographer "first_name last_name"
store first_name last_name as the photographer of image(s)
--people "first_name last_name [, first_name last_name]"
store the named people (as seen on the picture from left to
right) with the image(s)
--location "place_title"
put the references to the image(s) into location
--field name="value"
set the image(s) field name to value; common fields are title
(text, 64 chars max), view (text, 64 chars max), description
(text), rating (1..10) or level (1..10); possible fields are
from the MySQL database, table photos;
view can be used to describe what can be seen in the photo.
Often this is covered by the location field but sometimes you
might want to be more specific, or to describe something you
don’t want to store in the database as a location (view is just
a string). In the demo the view field is used in a photo of Big
Ben in London: the location is set to Parliament (since that was
where the photographer was standing) and the view to Big Ben
(since that was what where the photographer was looking at).
In the description field you can store additional information
that doesn’t fit elsewhere.
level is used for access privileges. When someone is granted
permission to view an album, they are also granted an access
level for that album. They will be able to view photos in that
album whose level is less than or equal to their access level.
This is so you can selectively exclude photos by giving them a
higher level.
--path path
the path relative to IMAGE_DIR (set in config.inc.php), where
the images are physically stored
--datedDirs
put photos in YYYY.MM.DD directories, which are automatically
created from the date in the Exif header, or, when no date is
found in the EXIF header, the file date. The directories are
created below path
--hierarchical
when given together with the --datedDirs option, the dated
directories are created YYYYMMDD (instead of YYYY.MM.DD), thus
creating a hierarchical directory tree. The directories are
created below path
--update
update existing photos, e.g. to edit database entries
--updateSize (implies --update)
update the photo’s width, height and size.
--updateExif (implies --update)
reparse and load the exit headers.
--nothumbnails
do not generate thumbnails
--thumbnails
(re)generate thumbnails (usually combined with --update)
--verbose
show verbosely whats going on
--copy
copy the images to the destination instead of moving them
--useIds id ...
use the numerical id from the database, not file names, to
identify photos for update
image ...
the name(s) of the image(s) to be imported or updated
EXAMPLES
zophImport --path dc280 --datedDirs ~/incoming/*.jpg
Reads the Exif headers of all photos ~/incoming/*.jpg, creates a
subdirectory for each date below IMAGE_DIR/dc280/ and moves the photos
to that place.
doit() { exiftran -aib $1 ; zophImport --updatesize --update
--thumbnails $1; }
Rotates images from your camera when they’re already stored in the
database (thanks Brian May for this tip, see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=284815 and exiftran(1)
for more details).
zophImport --path dc280 --datedDirs --photographer "Jason
Geiger" --location "Jason’s Apartment" --album "Zoph Tutorial"
~/incoming/*.jpg
Same as above, plus updates the database with entries for photographer,
location and album.
perl -e ’use DBI; $dbh = DBI->connect("DBI:mysql:zoph",
"zoph_rw", "zoph_rw") or die; $sth = $dbh->prepare("select *
from photos where 1 = 0"); $sth->execute() or die; $names =
$sth->{"NAME"}; foreach $name (@$names) { if ($name !~ /_id$/
and $name ne "path" and $name ne "name" and $name ne
"timestamp") { print $name, "\n"; } } $sth->finish();
$dbh->disconnect();’
List all fields, that can be selected by the --field Option (using the
installation default password). Note that modifying many of them (i.e.
image size) usually doesn’t make sense.
RETURN VALUES
0: success
1: no arguments given (try --help)
10: image not found
20: person not found
30: location not found
40: album not found
50: category not found
CONFIGURATION FILE
Configuration for both zophImport.pl and zophExport.pl are stored in
$HOME\.zophrc. An example file is included with Zoph. The following
settings need to be made in order to make zophImport.pl and
zophExport.pl work:
$db_host:
Hostname or IP address of your MySQL server.
$db_name:
Name of the database.
$db_user:
Username Zoph should use to log on to the MySQL server.
$db_pass:
Password Zoph should use.
$db_prefix:
Prefix to include before each tablename (in order to enable
sharing of the Zoph database with other apps - for example if
you have a limitted number of databases with your hosting
account).
$image_dir:
Location of your photos. Make sure it ends with /. Note that
these settings should have a matching entry in config.inc.php.
AUTHORS
zoph was written by Jason Geiger <zoph@nother.net> and is now
maintained by Jeroen Roos (zoph@roosnet.demon.nl)
this manpage was created by Mark Cooper and edited by Edelhard Becker
<becker@edelhard.de> and Jeroen Roos <zoph@roosnet.demon.nl>
SEE ALSO
zophExport(1), http://localhost/doc/zoph/manual.html,
http://en.wikibooks.org/wiki/Zoph