For web publishing: quickly see what you are working with in your image directories. To use save to your image directory, fix the path to Perl, permissions and you are set.
The output of this file flows all the images with their respective filenames in the body (scrolling them vertically) and reports a simple list in the top right of the page (offscreen to the right).
Probably would make a more effective tool (long term) if it were just a generic file browser/path-supplier and the rendering of the content were done client-side. Build in search, filtering, etc and return the appropriate file info.
#!/usr/bin/perl -wT
# jimmont.com/resrc/thumbs
BEGIN {
$ENV{PATH} = "/bin:/usr/bin";
delete @ENV{qw( IFS CDPATH ENV BASH_ENV )};
};
# todo... in perl
@list = `find . \\( -iregex '.*\.jpe?g?\$' -o -iname '*.gif' -o -iname '*.png' \\) -print`;
chomp(@list);
$list = '';
$images = '';
foreach $img (@list) {
$img =~ s/[^.a-z0-9_\-\/]//gi;
$list .= "$img<br>";
$images .= qq~<div><img src="$img" alt="$img" title="$img"><br>$img</div>~;
}
print qq~Content-type:text/html\n\n
<html><head>
<style type='text/css'>img{border:1px solid black;}div{float:left;margin:1em;font:9px verdana, sans-serif;}</style></head><body>
<div style='width:100%'>$images
<div style='position:absolute;top:0;left:100%;font-size:11px'>$list</div></div></body></html>~;
exit 0;