tags:

views:

153

answers:

1

i am sure that my gdlib is enabled since the imagecreafromjpeg() function precedes the part where i call the imagecreatruecolor() and there's no error generated from that

however the script breaks on the part (or rather fails with no error message and simply returns false) where imagecreatruecolor() is called..
how can i find the cause of the failure?

if ($filetype=='jpg' || $filetype=='jpeg')
 $src_img = imagecreatefromjpeg($name);  
if ($filetype=='png')
 $src_img = imagecreatefrompng($name);  
if($src_img===false){ return false;}

$orig_w = imageSX($src_img);
$orig_h = imageSY($src_img);
$new_w = ($orig_w > $new_w) ? $new_w : $orig_w;
$new_h = ($orig_h > $new_h) ? $new_h : $orig_h;
$dst_img = imagecreatetruecolor($new_w,$new_h);
A: 

Create a phpinfo-file to check your GD-version. imagecreatetruecolor() is only available in version 2.0.1 or later (they recommend 2.0.28).

Try the "function_exists('imagecreatetruecolor')" as well.

Björn