mirror of
https://github.com/friendica/friendica
synced 2025-04-26 09:50:15 +00:00
When a server isn't reachable there were timeout problems with fetching image data
This commit is contained in:
parent
135052a5a0
commit
5ec2c7e965
3 changed files with 18 additions and 10 deletions
|
@ -792,15 +792,19 @@ function get_photo_info($url) {
|
|||
|
||||
$filesize = strlen($img_str);
|
||||
|
||||
$tempfile = tempnam(get_temppath(), "cache");
|
||||
if (function_exists("getimagesizefromstring"))
|
||||
$data = getimagesizefromstring($img_str);
|
||||
else {
|
||||
$tempfile = tempnam(get_temppath(), "cache");
|
||||
|
||||
$a = get_app();
|
||||
$stamp1 = microtime(true);
|
||||
file_put_contents($tempfile, $img_str);
|
||||
$a->save_timestamp($stamp1, "file");
|
||||
$a = get_app();
|
||||
$stamp1 = microtime(true);
|
||||
file_put_contents($tempfile, $img_str);
|
||||
$a->save_timestamp($stamp1, "file");
|
||||
|
||||
$data = getimagesize($tempfile);
|
||||
unlink($tempfile);
|
||||
$data = getimagesize($tempfile);
|
||||
unlink($tempfile);
|
||||
}
|
||||
|
||||
if ($data)
|
||||
$data["size"] = $filesize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue