Limit the size of contact avatars
[friendica.git/.git] / src / Object / Image.php
index c1da711..4645a86 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