diff --git a/include/Photo.php b/include/Photo.php index 580fd25b6..2f7c99025 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -764,11 +764,16 @@ function get_photo_info($url) { if (is_null($data)) { $img_str = fetch_url($url, true, $redirects, 4); + $filesize = strlen($img_str); + $tempfile = tempnam(get_temppath(), "cache"); file_put_contents($tempfile, $img_str); $data = getimagesize($tempfile); unlink($tempfile); + if ($data) + $data["size"] = $filesize; + Cache::set($url, serialize($data)); } else $data = unserialize($data);