Maybe we can detect animated files in core

This commit is contained in:
Mikael Nordfeldth 2015-01-25 22:10:57 +01:00
parent 470971cf47
commit 4dd6d7869e
3 changed files with 13 additions and 3 deletions

View File

@ -131,7 +131,8 @@ $default =
'delete' => false, 'delete' => false,
'move' => true), 'move' => true),
'image' => 'image' =>
array('jpegquality' => 85), array('jpegquality' => 85,
'resize_animated' => false), // true doesn't mean we _can_, only that we will _try_ (plugins might do it)
'avatar' => 'avatar' =>
array('server' => null, array('server' => null,
'dir' => INSTALLDIR . '/avatar/', 'dir' => INSTALLDIR . '/avatar/',

View File

@ -52,7 +52,7 @@ class ImageFile
var $height; var $height;
var $width; var $width;
var $rotate=0; // degrees to rotate for properly oriented image (extrapolated from EXIF etc.) var $rotate=0; // degrees to rotate for properly oriented image (extrapolated from EXIF etc.)
var $animated = false; // Animated image? (has more than 2 frames) var $animated = false; // Animated image? (has more than 1 frame)
function __construct($id=null, $filepath=null, $type=null, $width=null, $height=null) function __construct($id=null, $filepath=null, $type=null, $width=null, $height=null)
{ {

View File

@ -49,7 +49,16 @@ if (!defined('GNUSOCIAL')) { exit(1); }
class ImageMagickPlugin extends Plugin class ImageMagickPlugin extends Plugin
{ {
// configurable plugin options must be declared public // configurable plugin options must be declared public
public $resize_animated = false; public $resize_animated = null;
public function initialize()
{
parent::initialize();
if (is_null($this->resize_animated)) {
$this->resize_animated = common_config('image', 'resize_animated');
}
}
/** /**
* @param ImageFile $file An ImageFile object we're getting metadata for * @param ImageFile $file An ImageFile object we're getting metadata for