2009-08-20 197 views
2

我确信,我的gdlib启用以来,imagecreafromjpeg()功能先在这里我所说的imagecreatruecolor()而且也没有从

但是剧本的部分破坏(或者说产生错误的部分失败,并没有错误消息,只是返回假)其中imagecreatruecolor()被称为..
我怎么找到失败的原因?

是什么导致imagecreatetruecolor()失败?

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); 
+0

是你的错误报告全爆炸? – deceze 2009-08-20 03:13:32

+0

显示代码... – Havenard 2009-08-20 03:14:01

+0

@havenard okee有代码 – lock 2009-08-20 03:23:04

回答

0

创建的phpinfo文件来检查你的GD-版本。 imagecreatetruecolor()仅在2.0.1或更高版本中可用(他们推荐2.0.28)。

也尝试“function_exists('imagecreatetruecolor')”。

0

有同样的问题。我所做的是在我的imagecreatetruecolor之前放置了error_report(E_ALL),并发现它需要更多的内存。刚刚升级我的php.ini到256mb,现在工作正常。

相关问题