This is the basic code, if there is something wrong with it, please let me know.
header("Content-type: image/gif");
$image = imagecreatefromgif($url);
imagealphablending($image, 1);
imagegif($image);
imagedestroy($image);
I also tried register_shutdown_function solution but this is not the fact, because when I test I do not stop the script from running by pressing the stop button.
It is still creating each time two temporary files in /tmp !!
Any ideas are welcome