#!/bin/bash
# usage:
#   jpg2kmzalbum *.jpg > album.kmz
#
# read out all EXIF coordinates from JPEG pictures
# and create Google Earth photo album
# frank, 7.4.2007

if [ $# -eq 0 ]; then
  echo "usage: jpg2kmzalbum *.jpg > album.kmz"
  exit
fi

tempdir=`mktemp -d`
mkdir $tempdir/files
cp $@ $tempdir/files

jpg2kmlalbum $@ > $tempdir/doc.kml

bash -c "cd $tempdir ; zip doc.kmz doc.kml files/*" > /dev/null

cat $tempdir/doc.kmz

rm -r $tempdir




