Test gd support on server
|
Author: Mattias (mattias@999tutorials.com) Categories: PHP |
||
|
|
||
|
The tutorial: Digg this, Post to del.icio.us, If you have manipulated images through PHP you have probably ran over the package GD. GD is a package that can be used through PHP if it's compiled with GD-support. Depending on what version of PHP you have, you might have different support for functions in GD. (GD can be read about here: http://www.boutell.com/gd/). I have created a great function that you can use to see both IF you have support for GD on your server, and also what functions are enabled. Some versions don't have support for all image formats (gif, png, jpg etc) because of copyright problems I think. Sometimes you have TTF (True type format) support so you can use fonts via gd when manipulating images. Run this function which is pretty straight forward to see what the status is for your GD :-)
Basicly it checks if we have GD support by checking if the function gd_info() exist. It only does if you have the package. You will get a simple YES or NO in the output if you have support or not. If you have support we get all gd-information via the function gd_info() and walk through it with foreach. Basicly I show all config values and after the name I show YES or NO. This is the output I got on one of my servers:
It looks like I can't write with Japanese fonts... Sounds ok with me, I don't understand what they say anyway :-) Let me know if you need any help on how to get started with GD!! Digg this, Post to del.icio.us, |
