Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP:ImageDestroy()和imagecopy()?_Php_Image_Memory Management_Php Gd - Fatal编程技术网

PHP:ImageDestroy()和imagecopy()?

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函数imagecopyresampled的图像内存

致命错误:允许的内存大小134217728字节已用尽,尝试分配12288字节

例如,我必须在循环中创建图像:

<?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