1
0
mirror of https://github.com/Intervention/image.git synced 2025-04-06 01:53:00 +02:00

Merge pull request #1247 from Intervention/epic/gif4

Adapt gif encoder api to intervention/gif v4
This commit is contained in:
Oliver Vogel 2024-01-07 10:11:20 +01:00 committed by GitHub
commit 71bb0e3449
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 14 additions and 15 deletions

View File

@ -14,7 +14,7 @@
"require": {
"php": "^8.1",
"ext-mbstring": "*",
"intervention/gif": "^3"
"intervention/gif": "^4"
},
"require-dev": {
"phpunit/phpunit": "^9",

View File

@ -27,8 +27,7 @@ class GifEncoder extends DriverSpecializedEncoder
{
$builder = GifBuilder::canvas(
$image->width(),
$image->height(),
$image->loops()
$image->height()
);
foreach ($image as $frame) {
@ -38,6 +37,8 @@ class GifEncoder extends DriverSpecializedEncoder
);
}
$builder->setLoops($image->loops());
return new EncodedImage($builder->encode(), 'image/gif');
}
}

View File

@ -2,7 +2,7 @@
namespace Intervention\Image\Encoders;
use Intervention\Gif\Exception\EncoderException;
use Intervention\Image\Exceptions\EncoderException;
use Intervention\Image\Interfaces\EncodedImageInterface;
use Intervention\Image\Interfaces\EncoderInterface;
use Intervention\Image\Interfaces\ImageInterface;

View File

@ -2,7 +2,7 @@
namespace Intervention\Image\Encoders;
use Intervention\Gif\Exception\EncoderException;
use Intervention\Image\Exceptions\EncoderException;
use Intervention\Image\Interfaces\EncodedImageInterface;
use Intervention\Image\Interfaces\EncoderInterface;
use Intervention\Image\Interfaces\ImageInterface;

View File

@ -4,5 +4,4 @@ namespace Intervention\Image\Exceptions;
class AnimationException extends \RuntimeException
{
//
}

View File

@ -4,5 +4,4 @@ namespace Intervention\Image\Exceptions;
class ColorException extends \RuntimeException
{
//
}

View File

@ -4,5 +4,4 @@ namespace Intervention\Image\Exceptions;
class DecoderException extends \RuntimeException
{
//
}

View File

@ -0,0 +1,7 @@
<?php
namespace Intervention\Image\Exceptions;
class EncoderException extends \RuntimeException
{
}

View File

@ -4,5 +4,4 @@ namespace Intervention\Image\Exceptions;
class FontException extends \RuntimeException
{
//
}

View File

@ -4,5 +4,4 @@ namespace Intervention\Image\Exceptions;
class GeometryException extends \RuntimeException
{
//
}

View File

@ -4,5 +4,4 @@ namespace Intervention\Image\Exceptions;
class InputException extends \RuntimeException
{
//
}

View File

@ -4,5 +4,4 @@ namespace Intervention\Image\Exceptions;
class NotSupportedException extends \RuntimeException
{
//
}

View File

@ -4,5 +4,4 @@ namespace Intervention\Image\Exceptions;
class NotWritableException extends \RuntimeException
{
# nothing to override
}

View File

@ -4,5 +4,4 @@ namespace Intervention\Image\Exceptions;
class RuntimeException extends \RuntimeException
{
//
}

View File

@ -3,7 +3,6 @@
namespace Intervention\Image;
use Traversable;
use Intervention\Gif\Exception\EncoderException;
use Intervention\Image\Analyzers\ColorspaceAnalyzer;
use Intervention\Image\Analyzers\HeightAnalyzer;
use Intervention\Image\Analyzers\PixelColorAnalyzer;
@ -23,6 +22,7 @@ use Intervention\Image\Encoders\MediaTypeEncoder;
use Intervention\Image\Encoders\PngEncoder;
use Intervention\Image\Encoders\TiffEncoder;
use Intervention\Image\Encoders\WebpEncoder;
use Intervention\Image\Exceptions\EncoderException;
use Intervention\Image\Geometry\Factories\CircleFactory;
use Intervention\Image\Geometry\Factories\EllipseFactory;
use Intervention\Image\Geometry\Factories\LineFactory;