#!/usr/bin/perl # Script Name: Image Indexer # Scripted By: U-L-T-R-A@webtv.net # Copyright © Date: 12-10-02 # Get this script and more at:http://ult-tex.net/scripts/ # Leave in all copyright statements and these 5 lines. # Environment variables. $server = $ENV{'SERVER_NAME'}; $script = $ENV{'SCRIPT_NAME'}; # Enter thumbnail height in pixels. $thumbsize = '100'; # Read in the form input. use CGI qw(param); $file = param('file'); # Read in the files. $dir = `pwd`; @Files = `ls $dir`; print "Content-type: text/html\n\n"; if ($file) { &img_tile; } # Begin the index page. $dirname = `dirname $script`; chomp($dirname); print qq~ Index of $dirname

Index of $dirname

\n~; if ($thumbsize) { print " WELCOME TO SCRI8E.COM

NO DIRECT LINKING
Images Always look $thumbsize % more beautiful when Transloaded to your own webspace!

Make something frosty. A name tag, a divider, a bar, a popsickle kid or pet. Animated or still. Split the frames if you are not an animation fan.

"; } print "


\n"; foreach (sort @Files) { chomp; &file_size; if (m/(gif|jpg|jpeg|png|swf)$/i) { use Image::Size; ($x, $y) = imgsize($_); if ($thumbsize && $y > $thumbsize) { $ht = $thumbsize; } else { $ht = $y; } $x = $x . 'w'; $y = $y . 'h'; print qq~

$_   Tile it   $size $x x $y


\n~; }} print qq~

Powered By: $server
CGI Source Code index.txt
Script © 2002-2005 By: U-L-T-R-A

~; # Begin the image tile page. sub img_tile { print qq~ $file tiled -->

  • FFFFFF White
  • 000000 Black
  • CDAD00 Gold
  • 4B0082 Indigo
  • 00FFFF Cyan
  • 515151 Grey
    Script © 2002-2004 By: U-L-T-R-A
  • ~; exit; } # Begin file size routine. sub file_size { $size = (-s); if ($size > 1000000) { $size = sprintf('%.2f', $size / 1000000) . ' meg'; } elsif ($size > 1000) { $size = sprintf('%.1f', $size / 1000) . ' kb'; } else { $size .= ' bytes'; } }