Jeg skal køre et lille perl script som laver thumbnails til nogen
billeder:
bruhn-tk:/home/ghashul# ./gallery.pl /sti/til/billede
: bad interpreter: No such file or directory
Hmm mærkeligt... Mit lille testscript virker udemærket så det er vel
ikke PERL der er helt gal, eller?
#!/usr/bin/perl
print "test\n";
gallery.pl ser således ud:
#!/usr/bin/perl
# thumbnail, (c) 2001 Darxus@ChaosReigns.com, released under the GPL.
#
http://www.ChaosReigns.com/code/thumbnail/
$pixelcount = 22500;
for $file (@ARGV)
{
@fullpath = reverse(split(/\//,$file));
$fullpath[0] = "../thumbs/tn_".$fullpath[0];
$newfile = join('/',reverse(@fullpath));
print "$newfile\n";
$info = `identify $file`;
if ($info =~ m#[^ ]+ (\d+)x(\d+)#)
{
$x = $1;
$y = $2;
} else {
print "Failed to parse info:$info\n";
}
#print "info:$info\n";
$pixels = $x * $y;
$newx = int($x / (sqrt($x * $y) / sqrt($pixelcount)));
$newy = int($y / (sqrt($x * $y) / sqrt($pixelcount)));
$newpix = $newx * $newy;
print("${x}x$y=$pixels -> ${newx}x$newy=$newpix\n");
#print "convert -geometry ${newx}x$newy $file $newfile\n";
#print "convert -geometry \"${newx}x${newy}\>\" $file $newfile";
`convert -geometry \"${newx}x${newy}\>\" $file $newfile`;
}
--
Regards Stefan
Websites:
http://3x7.dk/ http://ghashul.dk/
For e-mail replace "spamfilter" with my first name.