Fix #4019: Animated Gifs not handled correctly with GMagick extension

This commit is contained in:
Lucas Bartholemy 2020-04-18 00:10:09 +02:00
parent d2a37eaafe
commit eaf3b59086
2 changed files with 8 additions and 2 deletions

View File

@ -2,13 +2,14 @@ HumHub Change Log
=================
1.5.1 (April 17, 2020)
1.5.1 (April 18, 2020)
----------------------
- Fix #4001: LDAP user sync error
- Fix #4004: Missing translation strings
- Fix #4009: Yii queue error handling broken
- Fix #4008: Some richtext images are embedded as Base64
- Fix #4019: Animated Gifs not handled correctly with GMagick extension
1.5.0 (April 15, 2020)

View File

@ -83,7 +83,12 @@ class PreviewImage extends BaseConverter
$image->resize($image->getSize()->widen($this->options['width']));
}
$image->save($this->file->store->get($fileName), ['format' => 'png']);
$options = ['format' => 'png'];
if (!($image instanceof \Imagine\Gd\Image) && count($image->layers()) > 1) {
$options = ['format' => 'gif', 'animated' => true];
}
$image->save($this->file->store->get($fileName), $options);
}