--------------------------------------------------------------------------- TravelGen - V1.0 - 19 Sep 2005 TravelGen - v1.0.1 - 04 Sep 2008 TravelGen - v1.0.2 - 09 Sep 2008 Copyright 2005-2008 - Matt Drown --------------------------------------------------------------------------- Travelgen was created because I wanted something that would allow me to make "travel log" style galleries, with text and images. This would be text and images mixed together. I had just purchased a DSLR and also wanted EXIF information dumped out on the screen. And for a final requirement, I wanted the pages to be static html. Something that would load fast, and have no dependencies on other libraries, or installs, etc. I looked at a number of different programs, and was using something called "htmlthumbnail" for awhile. But that didn't allow me to generate multiple html files from a single config, or add custom text easily. TravelGen was created at that point. Over the past couple of years, I've been using it to create multiple pages. And decided to release it to the public for use, or example code. REQUIREMENTS: exiftool - perl module (cpan install Image::ExifTool) imagemagick & imagemagick-perl - you need one that supports the strip() function. I'm using 6.2.8. HOW TO USE: It's perl, so nothing to do but run it. It reads the config file "travelgen.cfg" from the current directory. It does not take this as an argument. This config file needs a couple things to work, at a minimum it needs to look like this: $outputfile index.html file1.jpg Commands all start with "$", and read to the end of the line. Any lines that start with a "#", are ignored until the end of the line. The command list is below, however, taking a look at the examples is probably easier to do. EXAMPLES: http://www.mattdrown.com/photos/tokyo2005/ http://www.mattdrown.com/photos/tokyo2005/travelgen.cfg http://www.mattdrown.com/photos/grandcanyon2005/ http://www.mattdrown.com/photos/grandcanyon2005/travelgen.cfg Functions in the config file: $var [var-name] [var-value] The runtime variable [var-name] is defined to have the value of [var-value]. Used to change behavior from the default behavior. See below for a list of the variables. $title [text] Generate text, with titleprefix and titlesuffix runtime variables around it. Useful to make quick seperations between groups of pictures on the same page. $ref [url] (link-text) $link [url] (link-text) Generate a link to the [url], with the (link-text) associated with it. Default text will be provided if you don't put anything. $outputfile [filename] Create a new file called [filename]. This will close the previous outputfile if one was open. $highlight [filename] (left|right) (size) (qual) Create a thumbnail of [filename], and place it on the left or right side. Jpeg is defined by default config, or by optional (size) and (qual) arguments. On the opposite side of the picture raw HTML is displayed until "$END" is read as the only item on a line. $caption [filename] (size) (qual) Similar to highlight, but image is placed in the center and no text is associated with it. Optional (size) and (qual) variable are applied during jpeg creation. preset variables: (You need to modify the source to change these) run_configfile - Default config file to read run_outpufile - Default output file to write run_topleveldir - Default top level directory for all files runtime variables, you can change these with the "$var" command. thumbnaildir - directory to place thumbnails thumbnailprefix - prefix to files (ie tn_) thumbnailsuffix - suffix to add to files thumbnailsize - size in pixels that longest side will be equal to thumbnailqual - jpeg quality used to encode thumbcentercrop - make uniform square thumbnails (trim borders) (yes/no) thumbtrimborder - trim the border/frame before making a thumbnail (yes/no) thumbtrimbordersize - pixels of border to trim (global) thumbaddborder - Add a border to the thumbnails only thumbaddbordersize - how many pixels to add for a border on thumbnails only thumbaddbordercolor - color of the border on the thumbnails only reducedir - directory to place reduced files reduceprefix - prefix to files (ie tn_) reducesuffix - suffix to add to files reducesize - size in pixels that longest side will be equal to reducequal - jpeg quality used to encode highlightdir - directory to place highlighted files highlightprefix - prefix to files (ie tn_) highlightsuffix - suffix to add to files highlightsize - size in pixels that longest side will be equal to highlightqual - jpeg quality used to encode captiondir - directory to place caption files captionprefix - prefix to files (ie tn_) captionsuffix - suffix to add to files captionsize - size in pixels that longest side will be equal to captionqual - jpeg quality used to encode regenthumbs - "no" will not regen thumbs if they are the proper size. "yes" will always regen thumbs. bodytext - The html code that is inserted after the body tag during the creation of all HTML pages. cellpadding - number of pixels of padding in the thumbnail tables. imagesperrow - number of thumbnail images per row on the contact sheet pages. includeoriginal - "yes" will include a link to the original picture "no" will only provide a link to the reduced picture displayfilename - "yes" to display the filename under the images exif - "yes" to display exif information on the thumbnail page exiftag - html code to be displayed when EXIF mode is turned on. Any text in parans () will be exchanged for the value associated with that name via a call to exiftags. center - "yes" to center all text displayed title - define the HTML title, displayed in the brower linkname - default text to put next to links titleprefix - html to display infront of title function call titlesuffix - html to display after title function call footer - html used to close every page imgsrcoptions - options added to all "img src" html tags html - Generate HTML page links, not jpeg links. (yes/no) exifhtmltag - Identical to "exiftag" but displayed with the html pages