View Single Post
widebody911 widebody911 is offline
Too big to fail
 
widebody911's Avatar
 
Join Date: Jan 2002
Location: Carmichael, CA
Posts: 33,894
Garage
Send a message via AIM to widebody911 Send a message via Yahoo to widebody911
I lost some of the formatting, but this shoudl work

I denote thumbnails with an '_' as the leading character of the file name, which is why I glob the list of file names as I do; I could have made cleaner with sed, but oh well...

Code:
#!/bin/sh

INDEX="index.html"
if [ ! -f "index.html" ]
then
	cat >> $INDEX << EOF
<html>
<head>
<link rel=stylesheet href='http://www.yourdomain.com/style.css' TYPE='text/css'>
<!--
Thom Fitzpatrick
-->
<meta name='description' content='Thom Fitzpatrick'> <title></title> </head> <body> <h4></h4> <p>

EOF
fi

for each in [a-zA-Z0-9]*.jpg [a-zA-Z0-9]*.JPG [a-zA-Z0-9]*.gif [a-zA-Z0-9]*.GIF [a-zA-Z0-9]*.TIF [a-zA-Z0-9]*.TIFF [a-zA-Z0-9]*.tif [a-zA-Z0-9]*.tiff [a-zA-Z0-9]*.png [a-zA-Z0-9]*.PNG do
	[ -f "$each" ] || continue
	[ ! -f "_$each" ] && convert -geometry 100 -quality 50 $each _$each 
	grep -qw "$each" $INDEX
	if [ $? -ne 0 ]
	then
		cat >> $INDEX << EOF
<br clear=left>
<hr size=1><p>
<a href=$each><img src=_$each></a> <br clear=left>

EOF
	fi
done
__________________
"You go to the track with the Porsche you have, not the Porsche you wish you had."
'03 E46 M3
'57 356A
Various VWs
Old 05-22-2006, 01:25 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #7 (permalink)