[magick-users] cropping animated gifs
Anthony Thyssen
A.Thyssen at griffith.edu.au
Wed Mar 25 00:13:52 PDT 2009
On Tue, 24 Mar 2009 10:20:19 +0000
Lex Thoonen <Lex at peng.nl> wrote:
| Hi Magick-users,
|
| I'using ImageMagick in a cgi script, to resize & crop uploaded mages
| to the desired format for the particular site.
|
| All is well, for jpg.
|
| But when I try a (animated) gif, it goes wrong. It crops away the parts that need
| to be cut away, but leaves them in the canvas so to say. I mean, the
| sizes of the images haven't changed.
|
| You can see what i mean here:
| http://www.allesoversterrenkunde.nl/test/upload.html
|
| Here's what I do:
|
| $cropcommand = $MaxFullimgX ."x" . $MaxFullimgY ."+" . $cropwidth ."+" . $cropheight ;
| $image->Crop( geometry=>$cropcommand , gravity=>'Center' ); # crop the image
|
|
| Now, at this page: http://tinyurl.com/cfkopm
|
| an answer is to a similar question is:
|
| To do it properly use...
| convert jumping_egg.gif -crop 146x167+20+25! cropped.gif
|
|
| Is there someone who knows if/how I can convert this to work in my cgi
| script? (And if that's the way forward?)
|
| Thanks,
|
| --
The '!' is part of the geometrystring which IM parses, you can just it
to the $cropcommand string.
Anthony Thyssen ( System Programmer ) <A.Thyssen at griffith.edu.au>
-----------------------------------------------------------------------------
Picard: Worf, do you have eleven weapons on you?
Worf: Of course not, sir.
Picard: Good... How many DO you have on you?
Worf: Fourteen. StarTrek NG, "Strike Zone"
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
More information about the Magick-users
mailing list