Search code examples
phpimage-loading

SimpleImage doesn't work with big files


I'm using SimpleImage (https://github.com/claviska/SimpleImage). I'm trying to edit a big photo: http://srv1.jpg.co.il/4/5401f91f41229.jpg (13312x1671, 3.2mb), and it returns this error after using the overlay() function:

( ! ) Fatal error: Maximum execution time of 50 seconds exceeded in C:\wamp\www\images\simpleimage.php on line 1163

the code in this line is:

$alphacolorxy = imagecolorallocatealpha($src_im, ($colorxy >> 16) & 0xFF, ($colorxy >> 8) & 0xFF, $colorxy & 0xFF, $alpha);

This is after adding those lines to the code:

ini_set('memory_limit', '-1');
ini_set('max_execution_time', '50M');

How can I fix it? I don't sure how it works, but I belive it isn't sending a http request because in the code the url is "pano.jpg" (this is the file name in the folder of the php code).


Solution

  •  set_time_limit(0);
    

    That should set the execution time to infinity.

    http://php.net/manual/en/function.set-time-limit.php