Also bei mir funktioniert es auf diesem Weg ganz:
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
#!/usr/bin/perl
use Image::Magick;
use CGI qw(:all);
use CGI::Carp qw/fatalsToBrowser/;
use strict;
my $cgi =CGI->new();
my $image = Image::Magick->new();
open(IMAGE, 'elbu.jpg');
$image->Read(file=>\*IMAGE);
close(IMAGE);
$image->Thumbnail(geometry => 'geometry', width => 200, height => 200);
my ($height, $width) = $image->Get('height', 'width');
my $xy = $width.'x'.$height;
$image->Annotate(font =>'arial.ttf',
stroke => 'red',
fill => 'blue',
gravity => 'SouthWest',
geometry => $xy,
pointsize => 20,
text => 'Froschpopo',
);
print $cgi->header('image/jpeg');
binmode STDOUT;
print $image->Write('jpeg:-');
Wirf auch mal einen Blick da rein:
ImageMagick.org