What is causing the imagecreatetruecolor () error?
I'm pretty sure my gdlib is enabled since the function imagecreafromjpeg()
precedes the part where I am calling imagecreatruecolor()
and no error is thrown from it
however the script breaks down to pieces (or rather fails with no error message and just returns false) where imagecreatruecolor()
...
how can i find the reason for the refusal?
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);
+2
source to share