From 84c8fd40e7ca912e16f18a29b8475c1579c04b4b Mon Sep 17 00:00:00 2001 From: Victor Wagner Date: Sun, 3 Oct 2010 17:58:58 +0000 Subject: [PATCH] Support for uppercase extensions. Added permission fix for files --- imagedir | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/imagedir b/imagedir index b118882..9d66c09 100755 --- a/imagedir +++ b/imagedir @@ -64,8 +64,10 @@ open OUT,">index.html"; print OUT "$dir\n\n

$dir

\n" ."

back

". "\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]; @@ -76,6 +78,7 @@ for ($j=0;$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); -- 2.39.5