PHP GD vs ImageMagick

Busy's picture

He has: 6,151 posts

Joined: May 2001

My host has been screwing around with Imagemagick and can't even tell me what version they have, so looks like I'm going to have to switch to GD.
Has anyone made the switch, if so any problems or lack of features (I understand GD is less powerful)

It's not a big job, but requirements are like so:
image uploaded - checked for size and format
image converted to .jpg if other format
image resized to set height/width
exif info removed
resolution set to set rating
image copied
image resized to smaller set size - placed center on background of blank image if not square
image copied
image resized to smaller set size - placed center on background of blank image if not square

and later on considering using a water mark (transparent image placed on top of images)

I'll have to hunt down some tutorials, but if anyone has any tips or warnings on GD or why I should stay with IM, would love to hear about them.

Cheers

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

as far as I know, all of that is totally possible with GD.

Here's a nice list of all the functions available in php with GD enabled:
http://ca.php.net/manual/en/ref.image.php
getimagesize();
imagecopyresized();
imagejpeg();
exif could be removed in the copyresize portion or the imagejpeg portion
as for resolution, I don't know exactly what you mean, but if you're referring to number of colours, it has that.
you can use the copyresize to put a smaller image centered on a larger black/white image.
Watermarks are also possible, you'd have to look into using the gd text/font functions with alpha blending functions.

They have: 161 posts

Joined: Jan 2005

Make sure that their GD library is up to date as many servers these days aren't! Sad

Busy's picture

He has: 6,151 posts

Joined: May 2001

Thanks, I had a peek at the PHP site before I posted, the coding seems a little complex compared with IM but I suppose mothing like a few late nights to get it sorted Wink

The EXIF is the image imformation - what digital cameras add to it.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.