Hallo!
Ich möchte in einem Verzeichnis alle Bilddateiein bearbeiten und mache ich es sorum:
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!C:\Perl\bin\perl.exe
use strict 'vars';
use Env;
use CGI::Carp qw(fatalsToBrowser);
use Image::Magick;
print <<BLOCK;
Content-type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body bgcolor="#400014" text="#00d8fc">
BLOCK
my($image, $x, $file);
$image = Image::Magick->new;
my $dirname = join('/', "$ENV{'DOCUMENT_ROOT'}", 'local/');
my $dirname2 = join('/', "$ENV{'DOCUMENT_ROOT'}", 'thumbs/');
opendir(DIR, $dirname);
while (defined($file = readdir(DIR))) {
next if $file =~ /^\.\.?$/;
print <<BLOCK;
<p><span style="font-family:tahoma, verdana, monospace; font-size:80%; font-weight: normal">$dirname$file</span></p>
BLOCK
$x = $image->Read('$file');
warn "$x" if "$x";
$x = $image->Crop(geometry=>'90x90+100+100');
warn "$x" if "$x";
$x = $image->Write('$dirname2$file');
warn "$x" if "$x";
print <<BLOCK;
<img src="$dirname2$file" border="1px" bcolor="#00d8fc" alt="$dirname2$file"><br>
BLOCK
}
closedir(DIR);
print <<BLOCK;
</body>
</html>
BLOCK
Was mache ich falsch, wenn ich keine Piktogramme im thumbs-Verzeichnis erzeugt bekomme?
Danke für Tipps!
:::bona mente:::