Skip to content

Commit 4211b38

Browse files
committed
fix thumbnail
1 parent aeccf1b commit 4211b38

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"keywords": ["image"],
55
"license": "MIT",
66
"require": {
7+
"php": "^7.1",
78
"imagine/imagine": "^0.6",
89
"guzzlehttp/guzzle": "^6.2",
910
"doctrine/cache": "^1.6"

src/ImageStack/ImageManipulator/ThumbnailRule/PatternThumbnailRule.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ protected function _thumbnailImage(ImageWithImagineInterface $image, ImagePathIn
108108

109109
/** @var IImage $animated */
110110
$animated = null;
111+
$options = null;
111112
$imagine = $image->getImagine();
112113
if ($this->handleAnimatedGif($image, function (IImage $iimage) use ($imagine, $size, &$animated, $image) {
113114
$animated = $imagine->create($size);
114115
$animated->layers()->remove(0);
116+
$image->setImagineImage($animated);
115117
// we take first frame conf
116118
/** @var IImage $iframe */
117119
$iframe = $iimage->layers()[0];
@@ -121,14 +123,13 @@ protected function _thumbnailImage(ImageWithImagineInterface $image, ImagePathIn
121123
'animated.delay' => $iframe->getImagick()->getImageDelay() * 10,
122124
'animated.loop' => $iframe->getImagick()->getImageIterations(),
123125
];
124-
// put those options for next binary dump only
125126
$image->setEphemeralImagineOptions($options);
126127
}, function (IImage $iframe) use ($size, $mode, &$animated) {
127128
$animated->layers()->add($iframe->thumbnail($size, $mode));
128129
}, function (IImage $iimage) {
129130
// nothing
130131
})) {
131-
$image->setImagineImage($animated);
132+
// nothing
132133
return true;
133134
}
134135
$image->setImagineImage($image->getImagineImage()->thumbnail($size, $mode));

0 commit comments

Comments
 (0)