XML Image Indexer Example


My images and movies (er, movie in this case)

youngoat@aardvark:/tmp/xii-example$ find .
.
./photos
./photos/2002-12-17
./photos/2002-12-17/DSC00005.JPG
./photos/2002-12-15
./photos/2002-12-15/DSC00002.JPG
./photos/DSC00017.JPG
./random.jpg
./videos
./videos/house.mpg

I run xii.pl

youngoat@aardvark:/tmp/xii-example$ xii.pl --xmlindex index.xml --thumbsize 100x100 --imagesize 800x600 out/ photos/ videos/ random.jpg

Let's see what happened.

youngoat@aardvark:/tmp/xii-example$ find out/
out/
out/photos
out/photos/2002-12-17
out/photos/2002-12-17/thumbs
out/photos/2002-12-17/thumbs/DSC00005.JPG
out/photos/2002-12-17/DSC00005.JPG
out/photos/2002-12-15
out/photos/2002-12-15/thumbs
out/photos/2002-12-15/thumbs/DSC00002.jpg
out/photos/2002-12-15/DSC00002.jpg
out/photos/thumbs
out/photos/thumbs/DSC00017.JPG
out/photos/DSC00017.JPG
out/videos
out/videos/thumbs
out/videos/thumbs/house000.jpg
out/videos/house.mpg
out/thumbs
out/thumbs/random.jpg
out/random.jpg
As you can see, it mirrored the original directory structure within the out directory. As you can't see, it resized all of the jpgs down to 800x600 (or smaller, to preserve aspect ratio). It also created thumbs directories with thumbnail images (no bigger than 100x100). Note that it created a thumbnail for the mpg as well (by using Frame Extractor).

The Index file

youngoat@aardvark:/tmp/xii-example$ cat index.xml <album> <image name="photos/2002-12-15/DSC00002.jpg"> <info DateTime="2002:12:20 13:40:54"/> <info file_media_type="image/jpeg"/> <info CompressedBitsPerPixel="2/1"/> <info ExposureBiasValue="0/10"/> <info ExposureTime="1/30"/> <info ISOSpeedRatings="282"/> <info Model="CYBERSHOT"/> ... <info width="800"/> <info height="600"/> ... <info ExifVersion="0210"/> <thumb path="photos/2002-12-15/thumbs/DSC00002.jpg" width="100" height="75"/> </image> <image name="photos/2002-12-17/DSC00005.JPG"> <info DateTime="2002:12:21 18:17:34"/> ... <info ExifVersion="0210"/> <thumb path="photos/2002-12-17/thumbs/DSC00005.JPG" width="100" height="75"/> </image> <image name="photos/DSC00017.JPG"> <info DateTime="2002:12:25 10:15:13"/> ... <info ExifVersion="0210"/> <thumb path="photos/thumbs/DSC00017.JPG" width="100" height="75"/> </image> <image name="/random.jpg"> <info DateTime="2002:12:25 10:44:12"/> ... <info ExifVersion="0210"/> <thumb path="/thumbs/random.jpg" width="100" height="75"/> </image> <movie name="videos/house.mpg"> <thumb path="videos/thumbs/house000.jpg" width="" height=""/> </movie> </album>
As you can see, the index contains an entry for every image and movie, complete with lots of metadata for images. Notice that some info about the thumbnails is also outputted.

Back to main XII page ...