Config File Description
General Info
The current version of the code generates a special text file after being run. This configuration file has the same name as the "-o" file with ".config.txt" appended.
You can use the program as it was used before and not bother with this file. However, this file allows you to access additional features of the program.
By default this file is created the first time the program is run in a directory and it is read it in each time the program is run.
The contents of the file looks something like this:
# img2index configuration file # file id string follows index_config_info_file default_thumb_size = 256 full_rule page_title = "An Index of Some Pictures" full_rule title_text = "JPEG Images" table_rule new_image file = "len_top_bw.jpg" text = "A very famous picture!" rotate = -90 new_image file = "len_top.jpg" text = "$file" new_image file = "test.jpg" text = "$file" table_rule title_text = "GIF Images" table_rule new_image file = "dog16.gif" text = "$file" table_rule
What do the commands mean?
The file contains commands which affect global parameters as well as the parameters for a particular image. Each command must occupy a single line, the white space and capitalization of commands is ignored, quotes on string arguments are optional, and lines that begin with "#" are considered comments and ignored.
Also note that the images are listed in the generated html file in the same order as the config file, so this allows you to re-order the images as you like.
Global Configuration and Formatting Commands
default_thumb_size = <int> specify the thumbnail image size default_column_count = <int> table column count default_border_width = <int> table border width, default is 1, for no border use 0 default_link_target = <str> specify the image link target which is inserted directly into the html, "_self" means use the same window, "_blank" means open a new window each time, "images" means open a new window - but reuse it for subsequent links page_title = <str> specify the page title, can be placed anywhere in the config file, and used more than once title_text = <str> end the current table and insert title text table_rule do not end the current table, but insert a horizontal divider in it full_rule end the current table and insert a horizontal rule row_end end the current table row, but not the table new_image start a new image specification raw_text = <str> end the current table and insert raw text table_rule_text = <str> do not end the current table, but insert a horizontal divider in it which contains text table_cell_text = <str> inserts the given text in the table as if it was an image vertical_spacer = <int> end the current table and insert the specified amount of vertical space (in pixels) raw_html = <str> end the current table and insert raw html <tr> start a new row <hr> nsert a horizontal rule and start a new row
Image Specification Commands
file = <str> specify image file name text = <str> specify image caption text, "$file" means use the file name rotate = <int> image rotation in degrees, valid values are -270, -180, -90, 0, 90, 180, 270
All commands can be abbreviated by the first letter of each word of that command. For example "vertical_spacer" can be abberviated as "vs".
Note that strings are allowed to contain arbitrary html. Also note that if an option is not specified, it will take on its default value.
How would I typically use this feature?
The typical way to use it is interactively. You'd run the program the first time to generate the thumbnails, the html file and the config file and load the html file in your browser. Then you'd edit the config file, run the program again, re-load the resulting html file. (Netscape users will probably have to use shift-reload if any image processing changes were specified.) Repeat this process until you've specified the options you want.
How can I get more control over the formatting?
The bad news is that control is somewhat limited. The good news is that all text which is inserted by config file commands can contain arbitrary html. However, there are two things to remember. The first is that if you quote a config file string argument (which is optional), nested quotes are allowed. The second is that a config file command automatically ends at the end of each line. The option for a big argument is either not to use line breaks (the current line length limit is about 16K) or break up the command and use multiple "raw_html" commands.
What if I specify a list of images as arguments and this file already exists?
If this file exists in a directory in which the program is run, it will match up the image arguments to the ones already in the list. New images will be appended to the end of the config file list with default options.
What is the "processed-images" directory?
This directory contains the processed versions of the images with the processing you've specified. The program will not modify your original files, but will generate new copies in this directory and the generated html will point to these modified versions.
What is the ".config.old.txt" file in the "thumbnails" directory?
This file is used by the program to determine if you made any changes to the ".config.txt" file. This allows it to only perform the processing for images whose parameters have changed since the last time the program is run.
How can I get a nice, clean version of a ".config.txt" file?
You can delete the file and a new one will be generated the next time you run the program. The same behavior can be achieved using the "-il 0" option.
To clean up an existing option you can use the "-id 1" option. The program will load in the existing file and write out a new one. Note that the current version of the program does not maintain comments, so they will not be present in the new file.
Contact: chuck@cs.cmu.edu -- First Edition: 4/26/01 -- Last modified: Mon Mar 18 13:36:35 EST 2002