4 Einträge, 1 Seite |
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
$x = $image->Write('$dirname2$file');
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!C:\Perl\bin\perl.exe
use strict;
use warnings;
use Env;
use CGI::Carp qw(fatalsToBrowser);
use Image::Magick;
sub GetLayoutName;
my $CSSFILE = &GetLayoutName();
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">
<head>
<title>::test::</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="expires" content="now" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="cache-control" content="no-store" />
<meta name="author" content="xxx" />
<meta name="description" content="xxx" />
<meta name="date" content="xxx" />
<meta name="robots" content="index,follow" />
<link rel="stylesheet" type="text/css" href="../outlook/$CSSFILE" />
<style type="text/css" title="currentStyle" media="screen">\@import "../outlook/$CSSFILE";</style>
</head>
<body class="all">
BLOCK
my($image, $x, $file);
my $neufile = 'n.jpg';
$image = Image::Magick->new;
my $dirname = join('/', "$ENV{'DOCUMENT_ROOT'}", 'local');
my $dirname2 = join('/', "$ENV{'DOCUMENT_ROOT'}", 'thumbs', "$neufile");
opendir(DIR, $dirname) or die ("Cannot open $dirname");
while (defined($file = readdir(DIR))) {
next if $file =~ /^\.\.?$/;
$file = join('/', "$dirname", "$file");
print <<BLOCK;
<br>Woher: $dirname Was: $file Wohin: $dirname2<br>
BLOCK
$x = $image->Read($file);
warn "$x" if "$x";
$x = $image->Crop(geometry=>'90x90+275+195');
warn "$x" if "$x";
$x = $image->Write($dirname2);
warn "$x" if "$x";
}
closedir(DIR);
my $thumbFile = 'noname.jpg';
my $thumbsDir = join('/', "$ENV{'DOCUMENT_ROOT'}", 'thumbs/');
opendir(DIR, $thumbsDir) or die ("Cannot open $thumbsDir");
while (defined($thumbFile = readdir(DIR))) {
next if $thumbFile =~ /^\.\.?$/;
print <<BLOCK;
<table>
<td><img src="../thumbs/$thumbFile" border="1px" bcolor="#00d8fc" alt="$thumbFile"><br></td>
</table>
BLOCK
}
closedir(DIR);
print <<BLOCK;
</body>
</html>
BLOCK
# ================================================================================
# GetLayoutName
# ================================================================================
sub GetLayoutName {
use Env;
$ENV{'HTTP_USER_AGENT'} =~ /(MSIE|Opera|Firefox)/;
my $BrowserName = $1;
my $LayoutName = "msie.css";
if ($BrowserName eq "Opera") {
$LayoutName = "opera.css";
} elsif ($BrowserName eq "Firefox") {
$LayoutName = "firefox.css";
} elsif ($BrowserName eq "Netscape") {
$LayoutName = "netscape.css";
} else {}
return $LayoutName;
}
4 Einträge, 1 Seite |