Limit the size of contact avatars

This commit is contained in:
Michael 2021-03-26 06:56:08 +00:00
parent 7e283dcdf4
commit e98d11a9ae
2 changed files with 38 additions and 0 deletions

View 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