Hi, I'm trying to create a function that handles upload of an avatar image, then crops it according to data received and saves it back. However, every time when it's run with file larger than 2MB I get a 500 error with the message, that I've run out of memory (268435456 bytes). This is the function, that should handle the whole process: http://bin.fuelphp.com/~KR What am I doing, that consumes so much memory?