Hi,

I thought about using Image::Magick to create thumbnails for image galleries 
(either 10 or 5 thumbnails per page) on the fly and tested the following:

#!/usr/bin/perl

use strict;
use warnings;
use Image::Magick;
use CGI;

my $q = new CGI;
my %parameters = $q->Vars();

my $image = Image::Magick->new( );
$image->Read("../htdocs/bilder/$parameters{dir}/image/$parameters{file}");
my ($height, $width) = $image->Get('height', 'width');
$height = ($height > $width) ? 128 : 96;
$width = ($height == 128) ? 96 : 128;
$image->Resize(height => $height, width => $width);

binmode STDOUT;
print $q->header( "image/jpeg" );
$image->Write("jpeg:-");

Unfortunately, this is unacceptably slow. I know that ImageMagick is quite 
ressource-intensive - but is there a way to significantly speed up the 
automatic generation of thumbnails?

Thanks,

Jan
-- 
A good programmer is someone who looks both ways before crossing a one-way 
street. - Doug Linder

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to