]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Image.php
Merge pull request #10086 from nupplaphil/feat/install_testrewrite
[friendica.git] / src / Object / Image.php
index c1da711f9ca14472326283feed129c0fa88d4d59..4645a8678a59fd1e330614315a364dfb01005a07 100644 (file)
@@ -575,6 +575,21 @@ class Image
                return true;
        }
 
+       /**
+        * Convert a GIF to a PNG to make it static
+        */
+       public function toStatic()
+       {
+               if ($this->type != 'image/gif') {
+                       return;
+               }
+
+               if ($this->isImagick()) {
+                       $this->type == 'image/png';
+                       $this->image->setFormat('png');
+               }
+       }
+
        /**
         * @param integer $max maximum
         * @param integer $x   x coordinate