Timeout on imagecreatefrom* functions
Posted: Thu Feb 16, 2006 7:53 pm
Hi,
I have a program where people can enter in a remote image file address to be later used with imagecreatefrom...().
The problem is that on some servers that images hosted are slow or dont plain work with these functions, therefore making my program act slow.
Is there a timeout where I can say if the function doesn't respond within 5 seconds to skip it and execute some other code or give me a bool for me to check ?
This wouldn't be correct or work but something like..
Any smart geniuses here ?
Thanks
I have a program where people can enter in a remote image file address to be later used with imagecreatefrom...().
The problem is that on some servers that images hosted are slow or dont plain work with these functions, therefore making my program act slow.
Is there a timeout where I can say if the function doesn't respond within 5 seconds to skip it and execute some other code or give me a bool for me to check ?
This wouldn't be correct or work but something like..
Code: Select all
$TOut = connection_timeout();
$GDimage = imagecreatefromjpeg('http://something.com/someimage.jpg');
if(!$TOut)echo "Exicuting Other Code";Thanks