No matter how big I set the memory limit to, imagick still keeps processing the image through a file on the disk.
Here is my php code:
$img = new Imagick();
$img->setResourceLimit(imagick::RESOURCETYPE_MEMORY, 1024*1024*1024); # i know this is stupid, but even 0, or 100, or 1024 don't work.
$img->readImage($tempfile);
here is a strace:
open("/tmp/magick-XXtLR7h2", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
fstat(5, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
brk(0x2797000) = 0x2797000
read(4, "\377\330\377\340\0\20JFIF\0\1\1\0\0\1\0\1\0\0\377\333\0C\0\1\1\1\1\1\1\1"..., 245760) = 245760
read(4, "\274\237\323\357\205d\270\273\271`\312\320\35\f\224\272\207X\273\260>\234\0179c\366\254&*\223L\363"..., 4096) = 4096
write(5, "\377\330\377\340\0\20JFIF\0\1\1\0\0\1\0\1\0\0\377\333\0C\0\1\1\1\1\1\1\1"..., 245765) = 245765