Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt gif encoder api to intervention/gif v4 #1247

Merged
merged 6 commits into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"require": {
"php": "^8.1",
"ext-mbstring": "*",
"intervention/gif": "^3"
"intervention/gif": "^4"
},
"require-dev": {
"phpunit/phpunit": "^9",
Expand Down
5 changes: 3 additions & 2 deletions src/Drivers/Gd/Encoders/GifEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ protected function encodeAnimated(ImageInterface $image): EncodedImage
{
$builder = GifBuilder::canvas(
$image->width(),
$image->height(),
$image->loops()
$image->height()
);

foreach ($image as $frame) {
Expand All @@ -38,6 +37,8 @@ protected function encodeAnimated(ImageInterface $image): EncodedImage
);
}

$builder->setLoops($image->loops());

return new EncodedImage($builder->encode(), 'image/gif');
}
}
2 changes: 1 addition & 1 deletion src/Encoders/FileExtensionEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Encoders/MediaTypeEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/Exceptions/AnimationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class AnimationException extends \RuntimeException
{
//
}
1 change: 0 additions & 1 deletion src/Exceptions/ColorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class ColorException extends \RuntimeException
{
//
}
1 change: 0 additions & 1 deletion src/Exceptions/DecoderException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class DecoderException extends \RuntimeException
{
//
}
7 changes: 7 additions & 0 deletions src/Exceptions/EncoderException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Intervention\Image\Exceptions;

class EncoderException extends \RuntimeException
{
}
1 change: 0 additions & 1 deletion src/Exceptions/FontException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class FontException extends \RuntimeException
{
//
}
1 change: 0 additions & 1 deletion src/Exceptions/GeometryException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class GeometryException extends \RuntimeException
{
//
}
1 change: 0 additions & 1 deletion src/Exceptions/InputException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class InputException extends \RuntimeException
{
//
}
1 change: 0 additions & 1 deletion src/Exceptions/NotSupportedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class NotSupportedException extends \RuntimeException
{
//
}
1 change: 0 additions & 1 deletion src/Exceptions/NotWritableException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class NotWritableException extends \RuntimeException
{
# nothing to override
}
1 change: 0 additions & 1 deletion src/Exceptions/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class RuntimeException extends \RuntimeException
{
//
}
2 changes: 1 addition & 1 deletion src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -23,6 +22,7 @@
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;
Expand Down
Loading