我有这个脚本:
function createThumb($source, $thumb_width=100)
{
$fl = dirname($source).'<br>';
$new_name = 'thumb_'.basename($source);
$img = imagecreatefromjpeg($source);
$width = imagesx($img);
$height = imagesy($img);
$new_width = $thumb_width;
$new_heght = floor($height * ($thumb_width / $width));
$tmp_name = imagecreatetruecolor( $new_width, $new_heght );
imagecopyresized($tmp_img, $img, 0, 0, 0, 0, $new_width, $new_heght, $width, $height);
imagejpeg($tmp_img, $fl.DIRECTORY_SEPARATOR.$new_name);
}
所有数据工作正常。我将每一步都回显到imagecopyresized
收到此警告的位置。
警告:imagecopyresized():提供的参数不是第 41 行 /www/mdkbg.com/keasport/root/admin/parsing_vars.php5 中的有效图像资源
可能是什么问题呢?我已将文件夹权限更改为 755,并使用 php5 文件提示。