rocknbil - 4:13 pm on Jun 1, 2012 (gmt 0)
Agreed on ImageMagick, even if you use it just for simple resizing it is more efficient (see below.) What's required is:
- ImageMagick binaries installed (most 'nix installations already have this)
- PHP must be compiled with iMagick, the PHP interface to ImageMagick. Many installations do not have this by default, you'll have to re-compile it or get your host to do so.
GD performs all it's functions in memory. What this means is if you have a compressed jpg, it will map it out in memory as an UNcompressed bitmap, which can often be huge.
For images larger than 2 MB, which is most raw camera images, you will often get "XX bytes of memory exhausted" using GD. In shared environments, you'll rarely be allowed to up the memory usage near anything useful.
ImageMagick performs most of these actions in virtual memory on disk, conserving memory and is generally faster overall. It also has a lot of things you can't do in GD, and does them better.