]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Image.php
Display mentioned users and in the comment box by default
[friendica.git] / src / Object / Image.php
index c6381bea851c7f589c47f7a41877ccfdb3285590..9143c23c16b3d2d15f095a097832df604365d6d1 100644 (file)
@@ -12,7 +12,6 @@ use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
-use Friendica\Model\Contact;
 use Friendica\Model\Photo;
 use Friendica\Util\Network;
 use Exception;
@@ -24,6 +23,7 @@ use ImagickPixel;
  */
 class Image
 {
+       /** @var Imagick|resource */
        private $image;
 
        /*
@@ -63,7 +63,7 @@ class Image
 
        /**
         * @brief Constructor
-        * @param object  $data data
+        * @param string  $data
         * @param boolean $type optional, default null
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
@@ -127,7 +127,7 @@ class Image
        }
 
        /**
-        * @param object $data data
+        * @param string $data data
         * @return boolean
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
@@ -299,8 +299,6 @@ class Image
                $width = $this->getWidth();
                $height = $this->getHeight();
 
-               $dest_width = $dest_height = 0;
-
                if ((! $width)|| (! $height)) {
                        return false;
                }
@@ -503,8 +501,6 @@ class Image
                $width = $this->getWidth();
                $height = $this->getHeight();
 
-               $dest_width = $dest_height = 0;
-
                if ((!$width)|| (!$height)) {
                        return false;
                }
@@ -694,8 +690,6 @@ class Image
                        return $string;
                }
 
-               $quality = false;
-
                ob_start();
 
                // Enable interlacing
@@ -737,7 +731,6 @@ class Image
                Logger::log('Image: guessType: '.$filename . ($fromcurl?' from curl headers':''), Logger::DEBUG);
                $type = null;
                if ($fromcurl) {
-                       $a = \get_app();
                        $headers=[];
                        $h = explode("\n", $header);
                        foreach ($h as $l) {
@@ -836,8 +829,6 @@ class Image
         */
        public static function getScalingDimensions($width, $height, $max)
        {
-               $dest_width = $dest_height = 0;
-
                if ((!$width) || (!$height)) {
                        return false;
                }
@@ -909,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);
@@ -968,8 +959,6 @@ class Image
 
                $hash = Photo::newResource();
 
-               $smallest = 0;
-
                // Pictures are always public by now
                //$defperm = '<'.$default_cid.'>';
                $defperm = "";