-
This rough script might be usefull. It makes a nice html "index.htm" that will show thumbnails of all your images in the dir it is run from (also subdirectories). Maybe it can gi ve you some ideas.
#!/bin/bash
#imake dir for thumbnails
mkdir -p icons
#Find all files and store list in $picfiles
picfiles=$(find . -type f -name "*")
#start writing html file
cat <<EOD > index.htm
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<html>
<head>
<title>test</title>
</head>
<body>
<h2>Click on these for a close up!</h2>
EOD
#initialize the lastdir variable
lastdir="Nuttnzzzzzzzz"
#loop through files making thumbnails of each
#and a link to it in index.htm
for matchfile in $picfiles
do
#add an s in the filename for the icon dir
outname=$(echo $matchfile |sed 's/.jpg$/s.jpg/')
#remove the ./ from the path
icdest=$(echo $outname |sed "s/^.\///")
#let the user see some progress
echo "$matchfile"
#compose and make the dir in the icons dir
newdir1=$(echo "./icons/$icdest" |sed "s/\/[^/]*$//")
mkdir -p "$newdir1"
#make the icon (thumbnail)
convert -resize 150x105 $matchfile ./icons/$icdest
#is this a new dir?
if [ $lastdir != $newdir1 ]
then
#print dir name to page when dir changes
printdir=$(echo $icdest |sed "s/\/[^/]*$//")
echo "<h3>$printdir</h3>" >>index.htm
fi
lastdir=$newdir1
#write the index point in page
echo "<a href=\"$matchfile\"" >>index.htm
echo "target=_blank ONCLICK=\"window.open(" >>index.htm
echo "'$matchfile'); return false\" ><img src=" >>index.htm
echo "\"./icons/$icdest\" border=\"0\"></a>" >>index.htm
done
#finish writing html file
echo "</body></html>" >> index.htm
Similar Threads
-
By Crenn in forum Hardware & Booting
Replies: 3
Last Post: 04-01-2005, 12:38 AM
-
By DelNorte in forum General Support
Replies: 1
Last Post: 03-22-2005, 07:27 AM
-
By zlibre in forum General Support
Replies: 2
Last Post: 10-08-2004, 03:00 AM
-
By knoppixnewbie in forum General Support
Replies: 2
Last Post: 02-19-2004, 05:58 AM
-
By knoppixnewbie in forum General Support
Replies: 2
Last Post: 02-17-2004, 04:13 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

HP ProLiant MicroServer Gen8 G1610T @2.3 GHz, 16GB, 712317-001 NO HDD/OS
$199.00

Supermicro 505-2 Server
$280.00

Supermicro 1U Network Server Appliance 16GB RAM 800GB SSD 6 LAN Ports Powers On
$450.00

Nasuni NF-50 Supermicro Server, Atom CPU C2558, @ 2.40GHz, 8GB RAM-No HDD/OS/AC
$250.00

Supermicro CSE-815-5 4B LFF Xeon E3-1240v5 16GB DDR4 1x 9361-8i 4x 1TB SATA HDD
$484.00

Supermicro CSE-815-5 4B LFF Xeon E3-1220v5 16GB DDR4 1x 9361-8i 4x 1TB SATA HDD
$477.00

Supermicro CSE-815-5 4B LFF Xeon E3-1240v5 8GB DDR4 1x 9361-8i 4x 1TB SATA HDD
$453.00

HP PROLIANT MICROSERVER GEN8 E3-1220LV2 @ 2.30GHz, 8GB RAM, NO HDD/OS
$164.97

Supermicro CSE-937 3U Storage Chassis No CPU No HDD No Ram Tested & Reset
$129.99

Supermicro CSE-937 3U Storage Chassis No CPU No HDD No Ram Tested & Reset
$129.99