]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Image.php
The "thread" table isn't used anymore
[friendica.git] / src / Object / Image.php
index 535eae0b33b8d845d52a506dbc086328a6a32a17..d69b01ad4d9e016180cca7916f2d4178116b2565 100644 (file)
@@ -22,7 +22,6 @@
 namespace Friendica\Object;
 
 use Exception;
-use Friendica\Core\System;
 use Friendica\DI;
 use Friendica\Util\Images;
 use Imagick;
@@ -123,7 +122,11 @@ class Image
                        $this->image->setFormat($format);
 
                        // Always coalesce, if it is not a multi-frame image it won't hurt anyway
-                       $this->image = $this->image->coalesceImages();
+                       try {
+                               $this->image = $this->image->coalesceImages();
+                       } catch (Exception $e) {
+                               return false;
+                       }
 
                        /*
                         * setup the compression here, so we'll do it only once
@@ -456,7 +459,6 @@ class Image
                                break;
                }
 
-               //      Logger::log('exif: ' . print_r($exif,true));
                return $exif;
        }
 
@@ -626,7 +628,7 @@ class Image
 
                $stamp1 = microtime(true);
                file_put_contents($path, $string);
-               DI::profiler()->saveTimestamp($stamp1, "file", System::callstack());
+               DI::profiler()->saveTimestamp($stamp1, "file");
        }
 
        /**
@@ -708,22 +710,6 @@ class Image
                return Images::getFormatsMap();
        }
 
-       /**
-        * Guess image mimetype from filename or from Content-Type header
-        *
-        * @param string  $filename Image filename
-        * @param boolean $fromcurl Check Content-Type header from curl request
-        * @param string  $header   passed headers to take into account
-        *
-        * @return string|null
-        * @throws Exception
-        * @deprecated in version 2019.12 please use Util\Images::guessType() instead.
-        */
-       public static function guessType($filename, $fromcurl = false, $header = '')
-       {
-               return Images::guessType($filename, $fromcurl, $header);
-       }
-
        /**
         * @param string $url url
         * @return array