A fail-safe way to prevent GD image library from running out of memory? (PHP)

前端 未结 6 1466
礼貌的吻别
礼貌的吻别 2020-12-31 20:01

Is there a way to prevent the PHP GD image library from running out of memory? If too large an image is uploaded, GD tends to run out of memory, terminating the script. I\'d

6条回答
  •  执笔经年
    2020-12-31 20:45

    After you create an image.

    imagepng($image);
    imagedestroy($image);
    

    will remove the memory problem

提交回复
热议问题