print OUT "<HTML><HEAD><TITLE>$dir</TITLE>\n<BODY>\n<H1>$dir</H1>\n"
."<p align=\"center\"><A HREF=\"..\">back</A></p>".
"<TABLE CELLSPACING=10 CELLPADDING=0 BORDER=0>\n";
-my @piclist=(<*.jpg>,<*.gif>,<*.png>) ;
-print STDERR "@piclist\n";
+my @piclist=grep (/\.(jpe?g|png|tiff?|gif)$/i, <*>) ;
+my @movielist= grep(/\.(mp4|avi|flv|mpg)$/i,<*>);
+print STDERR "Pictures found @piclist\n";
+print STDERR "Videos found @movielist\n";
my ($prev,$next);
for ($j=0;$j<=$#piclist;$j++) {
$_ = $piclist[$j];
$next = undef;
}
print STDERR "$j:$_";
+ chmod 0644, $_;
my $info = image_info($_);
my $thumbname=rescale($_,THUMBDIR,THUMBSIZE,$info);
my $inlinename=rescale($_,INLINEDIR,INLINESIZE,$info);