1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-29 08:40:33 +02:00
This commit is contained in:
Oliver Vogel
2021-10-21 17:01:27 +02:00
parent 5881789549
commit f540e07ed3
3 changed files with 3 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ class GifEncoder extends AbstractEncoder implements EncoderInterface
protected function encodeAnimated($image): string
{
$builder = GifBuilder::canvas($image->width(), $image->height(), 2);
$builder = GifBuilder::canvas($image->width(), $image->height(), $image->getLoops());
foreach ($image as $key => $frame) {
$source = $this->encode($frame->toImage());
$builder->addFrame($source, $frame->getDelay());

View File

@@ -24,7 +24,7 @@ class BinaryImageDecoder extends AbstractDecoder implements DecoderInterface
$imagick = $imagick->coalesceImages();
$image = new Image(new Collection());
$image->setLoops($imagick->getNumberImages());
$image->setLoops($imagick->getImageIterations());
foreach ($imagick as $frame_content) {
$image->addFrame(new Frame($frame_content));

View File

@@ -19,6 +19,7 @@ class GifEncoder extends AbstractEncoder implements EncoderInterface
$gif->addImage($frame->getCore());
}
$gif->setImageIterations($image->getLoops());
$gif->setFormat($format);
$gif->setImageFormat($format);
$gif->setCompression($compression);