Thread * interpretieren (3 answers)
Opened by Strazke at 2005-09-18 04:08

Strazke
 2005-09-18 04:08
#5625 #5625
User since
2005-07-11
120 Artikel
BenutzerIn
[default_avatar]
Hallo, ich habe jetzt einen kleinen Thumbnailgenerator:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /usr/bin/perl -w

use strict;
use Image::Magick;

my $img = Image::Magick->new;
my $filename="";
my $num_frames=0;
my (@pfad,$pfad);

foreach (@ARGV) {
@pfad = split("/",$_);
$filename = pop(@pfad);
$pfad = join("/",@pfad);
$img->Read($pfad."/".$filename);
$num_frames = scalar @$img;
print "Number of frames: $num_frames\n";
$#$img = 0;
my ($w,$h) = $img->Get("width","height");
print "Width: $w\nHeight: $h\n";
my $x=$w/80;
if(($h/$x) > 80) {
$x = $h/80;}
print "New size:\nWidth: ".($w/$x)."\nHeight: ".($h/$x)."\n";
$img->Resize(width=>($w/$x),height=>($h/$x));
$img->Write($pfad."/thm_".$filename);
}


Das Problem ist, dass ich nicht einfach sagen kann: /dir/*.gif
oder sowas.

View full thread * interpretieren