About the water collection

This text describes how these pages, representing a simple image collection, were created from XML-enhanced TIFF images. See:

http://bliss.lib.ncsu.edu/xml/water/water.html

In a nutshell, XML data was extracted from the description tags of TIFF files and converted into HTML through XSLT, the TIFF files were converted into thumbnail images, and the whole thing was brought together by creating a simple browsable list.

TIFF Helper

The process begins with TIFF Helper, a rudimentary web-based application allowing people to write XML data to the description tag of TIFF files. I did this with a small set of images representing items from my water collection. ("Yes, I collect water, and I have about 150 waters from all over the world.") For a demonstration and deeper explanation of TIFF Helper, see:

http://bliss.lib.ncsu.edu/xml/tiff-helper/

The primary goal of TIFF Helper is to provide a means for "marrying" the description of an image file with the image itself and not having to rely on an second application (say a database) to save and manage this information. Embedding descriptive information about images in the image files themselves provides a means for image archiving and distribution that is standards-based as well as operating system- and application-independent.

Making HTML pages

Now that I had a set of XML-enhanced TIFF files I needed a way to automatically create sets of Web pages from these files. To do this I had a number of utility applications at my disposal.

Tiffinfo

The first utility application was tiffinfo. This little program reads TIFF files and outputs their headers. Tiffinfo is written in C and therefore should be available for just about any computing platform. It is available as a part of the libtiff distribution described at the following URL:

http://www.libtiff.org/

Essentially, tiffinfo does the exact opposite of tiffset, the heart of the TIFF Helper application.

Convert

Convert is another open source application distributed with ImageMagick:

http://www.imagemagick.org/

Using convert and its friends (display, import, animate, montage, mogrify, identify, and combine) a person can do all sorts of image manipulations. In this case convert is simply used to read a TIFF file and "convert" it to a JPEG image while scaling the original image by 33%.

Xalan

The third utility was xalan, a Java application used to convert XML data to plain text files such as HTML, SQL, other XML files, etc. See:

http://xml.apache.org/

Knowing what my XML looked like inside the TIFF files I was able to write an XSTL "stylesheet" to convert the XML to HTML. The pages my stylesheet creates are simple, but they are consistent. They include all the descriptive information from the TIFF files as well as a thumbnail image of the original and a link to the TIFF files themselves.

Water.pl, the glue

To automate and "glue" the entire process together I wrote a Perl program (water.pl) looping through command line input processing each TIFF file. Water.pl:

  1. defines a few constants pointing to the three utilities described above
  2. converts each TIFF to a JPEG image
  3. extracts the XML and saves it to a file
  4. converts the XML file to an HTML file
  5. creates a simple browsable list of all the input

Conclusion

If TIFF files were enhanced with XML data, then the descriptions of those files could be directly associated with their images. Water.pl demonstrates one way of extracting that XML data and making sets of TIFF images available on the Web.

Instead of creating sets of HTML pages from the embedded XML, water.pl could have as easily created SQL statements and updated a (relational) database. Water.pl could have also created a PDF document representing a printed catalog that included pictures of the collection as well.

In short, this was simply a demonstration of how XML could be used in libraries. Complete code including the TIFF images and XSLT stylesheet are available in the following archive:

http://bliss.lib.ncsu.edu/xml/water/water.tar.gz


Eric Lease Morgan (eric_morgan@ncsu.edu)
URL: http://bliss.lib.ncsu.edu/xml/water/about.html
Date: March 28, 2001