-
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

USB 3.0 Flash Drive 32GB 64GB 128GB Memory Stick Thumb Stick Lot Pack
$826.09

MICRON MTA36ASF4G72PZ-2G6D1 32GB PC4-21300R DDR4-2666V RDIMM 2RX4 MEMORY DIMM
$139.99

Lot of 18 Mixed Brands PC4 32GB 2400T-R Server RAM
$2879.99

TF/SD Card Adapter Camera Reader Android Type-c For iPhone17 Pro Max Plusm lot
$573.98

Kingston 32GB 64GB 128GB 256GB USB 3.0 Flash Drive Thumb Memory Stick Pen lot
$285.90

Samsung 32GB DDR4-2666V-2Rx4-RB2-12 RAM M393A4K40CB2-CTD6Q
$169.00

USB 3.0 Micro SD SDHC TF Card Reader Memory Adapter for PC Laptop Camera lot
$3.75

SK Hynix 32GB PC4-2400T DDR4-2400 ECC RDIMM Server RAM HMA84GR7AFR4N-UH Tested
$235.00

1/ 10/ 100pcs USB 2.0 2GB, 4GB ,8GB ,16GB ,32GB ,64GB 128GB USB Flash Drives Lot
$202.50

Microsoft Office 2021 Pro Plus USB for 1PC Windows 10 & 11
$62.55