Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the odds of GD or ImageMagick already being part of a client's PHP install?

I'm working on a package which includes rescaling of images in PHP. For image rescaling, PHP has the GD and ImageMagick libraries. Are those likely to be part of a given client's PHP install already?

Is there a "default" install of PHP, for that matter? By default, are either GD or ImageMagick included?

If neither is installed, should I have some sort of horrible fallback position of reading, rescaling, and saving GIFs, JPGs, and PNGs, or is it simple to add GD or ImageMagick to an existing install?

like image 806
Nosredna Avatar asked Dec 04 '22 15:12

Nosredna


1 Answers

i can't remember when i've last seen a lamp hosting provider without GD. the imagemagick extension is not that widespread. if they run their server themself, they really should be able to activate one of it or both. in your place i'd build the full functionality with GD and a (probably reduced) imagemagick fallback. if they got neither, show them the basic concepts of the wheel and/or fire, they should be grateful.

PS: i encountered providers that deactivated certain GD functions (computationally too intensive on a shared hosting environment), like imagerotate and imagefilter.

like image 162
stefs Avatar answered Dec 06 '22 11:12

stefs