I have a problem with GD when I create images with php.
It is strange that it works on the same server with php version 5.3.1, but not on php version 5.2.14. (I'm not sure if this is the version of php or GD lib that does this.)
This file is created with conversion and stored in the directory in captcha::get_file() .
And this file is generated using imagecreatefrompng() and imagepng()
I made small changes to the script and made a gif. But the problem with png
What causes this and how to fix it?
Here is the phpcode:
<?php session_start(); require_once("./captcha.php")); // creates the image with convert and returns the location of the picture // document_root/picture/picture.png $picloc = captcha::get_file(); $image = @imagecreatefrompng($picloc); header('Content-type: image/png'); imagepng($image); imagedestroy($image); unlink($picloc); ?>
source share