1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-21 13:11:18 +02:00

Added Frame::getSize()

This commit is contained in:
Oliver Vogel
2021-10-29 20:10:27 +02:00
parent e475b28f01
commit 088f92147d
3 changed files with 13 additions and 0 deletions

View File

@@ -5,8 +5,10 @@ namespace Intervention\Image\Drivers\Gd;
use GdImage;
use Intervention\Image\Collection;
use Intervention\Image\Drivers\Abstract\AbstractFrame;
use Intervention\Image\Geometry\Size;
use Intervention\Image\Interfaces\FrameInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\SizeInterface;
class Frame extends AbstractFrame implements FrameInterface
{
@@ -48,6 +50,11 @@ class Frame extends AbstractFrame implements FrameInterface
return $this->core;
}
public function getSize(): SizeInterface
{
return new Size(imagesx($this->core), imagesy($this->core));
}
public function getDelay(): float
{
return $this->delay;

View File

@@ -20,6 +20,11 @@ class Frame extends AbstractFrame implements FrameInterface
return $this->core;
}
public function getSize(): SizeInterface
{
return new Size($this->core->getImageWidth(), $this->core->getImageHeight());
}
public function getDelay(): float
{
return $this->core->getImageDelay() / 100;

View File

@@ -6,6 +6,7 @@ interface FrameInterface
{
public function toImage(): ImageInterface;
public function getCore();
public function getSize(): SizeInterface;
public function getDelay(): float;
public function setDelay(float $delay): FrameInterface;
public function getDispose(): int;