Since all GIF support was removed from the GD library in version 1.6, this function is not available if you are using that version of the GD library.
The following code snippet allows you to write more portable PHP applications by auto-detecting the type of GD support which is available. Replace the sequence Header("Content-type: image/gif"); ImageGIF($im); by the more flexible sequence:
<?php
if (function_exists("imagegif")) {
Header("Content-type: image/gif");
ImageGIF($im);
}
elseif (function_exists("imagejpeg")) {
Header("Content-type: image/jpeg");
ImageJPEG($im, "", 0.5);
}
elseif (function_exists("imagepng")) {
Header("Content-type: image/png");
ImagePNG($im);
}
elseif (function_exists("imagewbmp")) {
Header("Content-type: image/vnd.wap.wbmp");
ImageWBMP($im);
}
else
die("No image support in this PHP server");
?>