【发布时间】:2013-08-27 12:40:40
【问题描述】:
我需要将这些图像合二为一。为此,我执行以下操作:
-
创建具有正确尺寸的空白图像
$full_image = imagecreate($full_width, $full_height); -
将png图片一张一张复制到空白图片上
imagecopy($full_image, $src, $dest_x, $dest_y, 0, 0, $src_width, $src_height)
但是,有些图像会变得非常大,例如:imagecreatetruecolor(8832, 3955);,我得到Allowed memory size of 134217728 bytes exhausted (tried to allocate 8832 bytes)
我想知道是否有一种方法可以将图像放在一起,而不会将整个图像存储在内存中。在生成图像时,可能会以一定的时间间隔将图像数据写入磁盘。
【问题讨论】: