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,
'move' => true),
'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' =>
array('server' => null,
'dir' => INSTALLDIR . '/avatar/',

View File

@ -52,7 +52,7 @@ class ImageFile
var $height;
var $width;
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)
{

View File

@ -49,7 +49,16 @@ if (!defined('GNUSOCIAL')) { exit(1); }
class ImageMagickPlugin extends Plugin
{
// 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