PHP:ImageDestroy()和imagecopy()?
可以删除PHP函数imagecopyresampled的图像内存 致命错误:允许的内存大小134217728字节已用尽,尝试分配12288字节 例如,我必须在循环中创建图像:PHP:ImageDestroy()和imagecopy()?,php,image,memory-management,php-gd,Php,Image,Memory Management,Php Gd,可以删除PHP函数imagecopyresampled的图像内存 致命错误:允许的内存大小134217728字节已用尽,尝试分配12288字节 例如,我必须在循环中创建图像: <?php while($break===false){ $img=imagecreate($x); } function imagecreate($x){ $tmp= imagecreatefromjpeg($x); imagecopyresampled($img,$t
<?php
while($break===false){
$img=imagecreate($x);
}
function imagecreate($x){
$tmp= imagecreatefromjpeg($x);
imagecopyresampled($img,$tmp,0,0,0,0,100,100,100,100);
//imagedestroy($img); ??This would be destroying before return the $img
return $img;
}
?>
如何将imagedestroy用于imagecopyresampled?Dude imagedestroy与从临时文件夹中销毁tmp_图像不同
imagecopyresampled从图像的原始副本创建重采样图像。imagedestroy$tmpnot用于imagecopyresampled的imagecreatefromjpeg