]> git.mxchange.org Git - friendica.git/commitdiff
Add the file size to the photo data array
authorMichael Vogel <icarus@dabo.de>
Wed, 31 Dec 2014 14:44:32 +0000 (15:44 +0100)
committerMichael Vogel <icarus@dabo.de>
Wed, 31 Dec 2014 14:44:32 +0000 (15:44 +0100)
include/Photo.php

index 580fd25b6af8f4bcd4ce7ed241d40b6460bce666..2f7c990256c392b7f00d083b49075b70f9d332f2 100644 (file)
@@ -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);