Table of Contents
archx.py scriptarchx.rnc schemaarchx.py: The scriptprocessArchive(): Process
the contents of one archiveprocessFile(): Check one
image filewriteIndex(): Output the
index for one archive directoryclass Imagex: An object to
describe one imageImagex.__init__():
ConstructorImagex.writeNode():
Translate self to XMLarchindex.py: Reader for archive index filesclass ArchiveIndex: Index of one archiveArchiveIndex.__init__():
ConstructorArchiveIndex.getArchImage(): Retrieve
an archived imageArchiveIndex.genArchImages():
Generate contained image entriesArchiveIndex.addArchImage(): Add one
imageArchiveIndex.readFile(): Instantiate
from XMLclass ArchImage: Archived catalog
entryArchImage.readNode(): Convert an XML
nodegetIntAttr(): Retrieve an
integer attribute valueThe 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-001, 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
(e.g., 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 birdimages.xml
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 scan
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
be written).
nnn.xml
This publication is available in Web
form and also as a PDF document. Please forward any comments to
john@nmt.edu.
Files mentioned in this document include:
archx.rnc: The schema for the output file in Relax
RNG Compact Syntax.
archx.py: The actual script.
dom_helpers.py: The author's
helper routines for use with the DOM (XML Document
Object Model).
For birdimages.py, see An XML-based bird image cataloging
system.