X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2FPhoto.php;h=ccb6af29e92c22447a715e9d41c4483cd8501b99;hb=26eceaacbe883b7ece20c0cfb5c724c8ba1a7d99;hp=580fd25b6af8f4bcd4ce7ed241d40b6460bce666;hpb=910293729c55eb1d21e2fb7d9c9b8888e368135d;p=friendica.git diff --git a/include/Photo.php b/include/Photo.php index 580fd25b6a..ccb6af29e9 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -516,7 +516,12 @@ class Photo { return FALSE; $string = $this->imageString(); + + $a = get_app(); + + $stamp1 = microtime(true); file_put_contents($path, $string); + $a->save_timestamp($stamp1, "file"); } public function imageString() { @@ -764,11 +769,21 @@ 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"); + + $a = get_app(); + $stamp1 = microtime(true); file_put_contents($tempfile, $img_str); + $a->save_timestamp($stamp1, "file"); + $data = getimagesize($tempfile); unlink($tempfile); + if ($data) + $data["size"] = $filesize; + Cache::set($url, serialize($data)); } else $data = unserialize($data); @@ -846,7 +861,10 @@ function store_photo($a, $uid, $imagedata = "", $url = "") { return(array()); } elseif (strlen($imagedata) == 0) { logger("Uploading picture from ".$url, LOGGER_DEBUG); + + $stamp1 = microtime(true); $imagedata = @file_get_contents($url); + $a->save_timestamp($stamp1, "file"); } $maximagesize = get_config('system','maximagesize'); @@ -870,7 +888,11 @@ function store_photo($a, $uid, $imagedata = "", $url = "") { */ $tempfile = tempnam(get_temppath(), "cache"); + + $stamp1 = microtime(true); file_put_contents($tempfile, $imagedata); + $a->save_timestamp($stamp1, "file"); + $data = getimagesize($tempfile); if (!isset($data["mime"])) {