Re: Graphics module



On Fri, 11 Nov 2005 02:46:57 GMT
Matt Silberstein <RemoveThisPrefixmatts2nospam@xxxxxxxxxxxxx> wrote:

> All I want to do is some little thumbnails, what do I do?
I did it using 'Imagemagick' module.

usage example (cut'n'pasted from big scripture):

use Image::Magick;

[...]

sub gen_malgranda ($$) {
my $x = Image::Magick->new(size=>'160x160');
$x->Read('NULL:white');
my $p = Image::Magick->new;
$p->Read("$_[0]/$_[1]");
$p->Scale("160x160");
$x->Composite(image=>$p,gravity=>'center');
$x->Write("$_[0]/malgranda/$_[1]");
undef $p, $x;
}

[...]

mkdir "/home/user/store/jpeg/malgranda";
gen_malgranda("/home/user/store/jpeg","somefile.jpeg");

--
Best wishes,
~ Serge. pubkeys: http://uch.net/~fisher/keys.asc
~fingerprint : 4346 2766 BC96 E77F 5BFF 1E7C 12C2 3852 E5FD DC34

Attachment:pgpNQ1qVNrzzY.pgp
Description: PGP signature



Relevant Pages

  • Re: Dealing with ImageMagick from PHP
    ... It handles taking photographs, categorizing them, making thumbnails of them, and allows parentsto view the photos and order them. ... Anyway -- the clients decided they wanted me to do some work on the image quality, so I finally decided to move up to ImageMagick v.6.3.4. ... I call ImageMagick from a "exec" call in PHP. ... They've asked if anything can be done about that, but I think I've optimized the shell script as much as possible. ...
    (php.general)
  • Re: [PHP] Re: Dealing with ImageMagick from PHP
    ... It handles taking photographs, categorizing them, making thumbnails of them, and allows parentsto view the photos and order them. ... Anyway -- the clients decided they wanted me to do some work on the image quality, so I finally decided to move up to ImageMagick v.6.3.4. ... I call ImageMagick from a "exec" call in PHP. ... They've asked if anything can be done about that, but I think I've optimized the shell script as much as possible. ...
    (php.general)
  • Dealing with ImageMagick from PHP
    ... It handles taking photographs, categorizing them, making thumbnails of them, and allows parentsto view the photos and order them. ... Anyway -- the clients decided they wanted me to do some work on the image quality, so I finally decided to move up to ImageMagick v.6.3.4. ... So, with ImageMagick 6.3.4, with the sharpening and compression I'm now using, the clients are absolutely in love with the thumbnail quality -- even though the amount of time it takes to make the thumbnails is much longer. ... Okay, I've rambled on plenty now, for my first post. ...
    (php.general)
  • Re: [PHP] Re: Dealing with ImageMagick from PHP
    ... There are a number of hints on the forum for speeding up things. ... It handles taking photographs, categorizing them, making thumbnails of them, and allows parentsto view the photos and order them. ... Anyway -- the clients decided they wanted me to do some work on the image quality, so I finally decided to move up to ImageMagick v.6.3.4. ... They've asked if anything can be done about that, but I think I've optimized the shell script as much as possible. ...
    (php.general)
  • FYI: Test Results Comparing Different Methods of Resizing Images
    ... thumbnails of large images, ... ImageMagick and PHP and compiled some statistics below. ... another at 120 pixels in width. ...
    (comp.lang.php)