Table of Contents
archx.py: The script
processArchive(): Process the contents of one archive
processFile(): Check one image file
writeIndex(): Output the index for one archive directory
class Imagex: An object to describe one image
Imagex.writeNode(): Translate self to XML
archindex.py: Reader for archive index files
class ArchiveIndex: Index of one archive
ArchiveIndex.getArchImage(): Retrieve an archived image
ArchiveIndex.genArchImages(): Generate contained image entries
ArchiveIndex.addArchImage(): Add one image
ArchiveIndex.readFile(): Instantiate from XML
class ArchImage: Archived catalog entry
ArchImage.readNode(): Convert an XML node
getIntAttr(): Retrieve an integer attribute value
The program described in this document is part of a system for indexing photos. For documentation on the base catalog, see An XML-based bird image cataloging system.
As scans are accumulated, they must be archived on CDs.
The current scheme is to place groups of reference PNG
files into directories named
bird-002, and so on, each sized to
fit on a CD.
The purpose of the
archx program is to build an index of
one of these CD-sized directories. Given an archive number
013 for archive directory
bird-013), it finds all the
.png image files in that directory, and does
these operations for each image:
The image file's base name should be its catalog
number. If that number is not defined in the
file, an error message is written.
The program reads the image file and determines its
image height and width in pixels. We can calculate
the actual image size using the
attribute in the image's catalog entry.
If there is no thumbnail image in the standard thumbnail directory, one is created.
A file named
arch- will be written by this script,
describing all the images in that file. This file will be
used as input to a later processing stage that builds a set
of web pages displaying the images of each species (yet to
Files mentioned in this document include: