Commit 4dd6d786 authored by mmn's avatar mmn

Maybe we can detect animated files in core

parent 470971cf
......@@ -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/',
......
......@@ -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)
{
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment