bin sh echo html head title Image Gallery title style IMG border none

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
echo '<html><head><title>
Image Gallery
</title><style>
IMG { border:none;vertical-align:top; }
</style></head><body style="padding:0;margin:5px;"><div style="width:100%"><div style="height:120px;width:100%;overflow:auto;white-space:nowrap;">'
for f in `ls -tr *.{jpg,JPG} 2>/dev/null`; do
echo $f > /dev/stderr
# thumbnail
convert $f -resize x100 -strip -gravity center -crop 100x100+0+0 -sharpen 2 -quality 30 t_$f
# view
convert $f -resize '1024x1024>' -sharpen 5 -quality 85 v_$f
# html
echo '<a href="v_'$f'" target="photo"><img src="t_'$f'" alt="'$f'"></a>'
done
echo '</div></div><iframe name="photo" frameborder="0" style="border:none;width:100%;height:85%;"></iframe></body></html>'