#!/bin/bash # $Id: make-gallery.sh,v 1.1 2005/08/25 14:13:56 spliffy Exp $ # Globals export height=180; export width=180; export normal_width=800; export normal_height=600; export rows=3; export dir_thumb="thumbs"; export dir_normal="normal"; export host=`uname -n`; export kernel=`uname -s`; export file_index="index.html"; export file_image="image.html"; export bordercolor="white"; export borderwidth=40; export title=`basename "$PWD"`; # html options export bgcolor="black"; export textcolor="white"; export linkcolor="silver"; export linkvisted="gray"; export linkactive="blue"; while getopts h:w:n:j:r:f:c:b:t:g:x:l:v:a: o 2>/dev/null do case "$o" in h) height="$OPTARG";; w) width="$OPTARG";; n) normal_width="$OPTARG";; j) normal_height="$OPTARG";; f) file_image="$OPTARG";; c) bordercolor="$OPTARG";; b) borderwidth="$OPTARG";; t) title="$OPTARG";; g) bgcolor="$OPTARG";; x) textcolor="$OPTARG";; l) linkcolor="$OPTARG";; v) linkvisted="$OPTARG";; a) linkactive="$OPTARG";; *) echo "Usage: $0 [-h height] [-w width] [-n intermediate_width]"; echo " [-j intermediate_height] [-r rows] [-f image_file]"; echo " [-c border_color] [-b border_width] [index_file]"; echo ""; echo "OPTIONS:"; echo " -h number thumbnail image heigth (default $height)"; echo " -w number thumbnail image width (default $width)"; echo " -n number intermediate image width (default $normal_width)"; echo " -j number intermediate image heigth (default $normal_height)"; echo " -r number number of rows (default '$rows')"; echo " -f filename filename of the image html file (default '$file_image')"; echo " -c html_col thumbnail canvas color (default '$bordercolor')"; echo " -b number thumbnail border width (default $borderwidth)"; echo " -t string gallery title (default '$title')"; echo ""; echo "HTML OPTIONS:"; echo " -g background color (default '$bgcolor')"; echo " -x text color (default '$textcolor')"; echo " -l link color (default '$linkcolor')"; echo " -v link visited color (default '$linkvisted')"; echo " -a link active color (default '$linkactive')"; echo ""; echo "index_file is the html index file to be generated, default: '$file_index'."; echo ""; echo "VARIABLES:"; echo " You may override the html header and footer by setting the"; echo " following environment variables:"; echo " \$ export html_header='html code'"; echo " \$ export html_footer='html code'"; echo ""; echo "NOTE:"; echo " the actual thumbnail size is (thumnail width + thumbnail border * 2)."; echo ""; exit 1;; esac done if [[ ! -z $1 ]]; then shift $OPTIND-1; fi if [[ ! -z $1 ]]; then file_index="$1"; fi; # html template html_buffer=""; if [[ -z $generated ]]; then generated=`date`; fi; if [[ -z $html_header ]]; then # html_header="\n
\n${jpeg}
| « Back | Übersicht | Next » |
| « Back | Übersicht | Next » |