]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Image.php
Reuse existing Strings::getRandomHex function
[friendica.git] / src / Object / Image.php
index ae360f376d505c43308d6e888ab0b74b667430c9..45c8bedeaf58397abe15b1b7684a009156f63cad 100644 (file)
@@ -5,6 +5,7 @@
  */
 namespace Friendica\Object;
 
+use Exception;
 use Friendica\App;
 use Friendica\Core\Cache;
 use Friendica\Core\Config;
@@ -14,7 +15,6 @@ use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Photo;
 use Friendica\Util\Network;
-use Exception;
 use Imagick;
 use ImagickPixel;
 
@@ -23,6 +23,7 @@ use ImagickPixel;
  */
 class Image
 {
+       /** @var Imagick|resource */
        private $image;
 
        /*
@@ -655,7 +656,7 @@ class Image
 
                $stamp1 = microtime(true);
                file_put_contents($path, $string);
-               $a->saveTimestamp($stamp1, "file");
+               $a->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
        }
 
        /**
@@ -801,7 +802,7 @@ class Image
                                        $a = \get_app();
                                        $stamp1 = microtime(true);
                                        file_put_contents($tempfile, $img_str);
-                                       $a->saveTimestamp($stamp1, "file");
+                                       $a->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
 
                                        $data = getimagesize($tempfile);
                                        unlink($tempfile);
@@ -899,7 +900,7 @@ class Image
 
                /// @TODO
                /// $default_cid      = $r[0]['id'];
-               /// $community_page   = (($r[0]['page-flags'] == Contact::PAGE_COMMUNITY) ? true : false);
+               /// $community_page   = (($r[0]['page-flags'] == User::PAGE_FLAGS_COMMUNITY) ? true : false);
 
                if ((strlen($imagedata) == 0) && ($url == "")) {
                        Logger::log("No image data and no url provided", Logger::DEBUG);
@@ -909,7 +910,7 @@ class Image
 
                        $stamp1 = microtime(true);
                        $imagedata = @file_get_contents($url);
-                       $a->saveTimestamp($stamp1, "file");
+                       $a->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
                }
 
                $maximagesize = Config::get('system', 'maximagesize');
@@ -923,7 +924,7 @@ class Image
 
                $stamp1 = microtime(true);
                file_put_contents($tempfile, $imagedata);
-               $a->saveTimestamp($stamp1, "file");
+               $a->getProfiler()->saveTimestamp($stamp1, "file", System::callstack());
 
                $data = getimagesize($tempfile);