Changes for PHP5 Version of GDLib, and Getting php5-gd to Work!
I had noticed that the GDLib functions were installed, yet the images would not generate the correct output. This is due to the change in some of the functions, such as imgpng();, which had an alteration of parameter handling, and is much more restrictive.
bool imagepng ( resource $image [, string $filename [, int $quality [, int $filters ]]] )
Let’s say we had called imagepng(); like we could in PHP4:
imagepng($image,”,90);
PHP4 didn’t complain when using it like that, as it was a bit more lenient on parameters. When using PHP5, you have to either output images as:
imagepng($image);
Or, you can use the full-blown
imagepng($image,NULL,90,NULL);
and it should work again. I haven’t tested the latter (though it should work), but I changed all of my GD programs and projects to imagepng($image);.
If you are having a problem getting GDLib to work and you have all of the modules installed correctly, check your phpinfo(); and/or gd_info();.
If all of those claim to be working, yet your results are now URL paths to the image, well, they are working - you are just using a deprecated method of using imagepng(); or imagejpeg();.
