mirror of
https://github.com/Intervention/image.git
synced 2025-08-22 05:22:50 +02:00
Added Frame::getSize()
This commit is contained in:
@@ -5,8 +5,10 @@ namespace Intervention\Image\Drivers\Gd;
|
|||||||
use GdImage;
|
use GdImage;
|
||||||
use Intervention\Image\Collection;
|
use Intervention\Image\Collection;
|
||||||
use Intervention\Image\Drivers\Abstract\AbstractFrame;
|
use Intervention\Image\Drivers\Abstract\AbstractFrame;
|
||||||
|
use Intervention\Image\Geometry\Size;
|
||||||
use Intervention\Image\Interfaces\FrameInterface;
|
use Intervention\Image\Interfaces\FrameInterface;
|
||||||
use Intervention\Image\Interfaces\ImageInterface;
|
use Intervention\Image\Interfaces\ImageInterface;
|
||||||
|
use Intervention\Image\Interfaces\SizeInterface;
|
||||||
|
|
||||||
class Frame extends AbstractFrame implements FrameInterface
|
class Frame extends AbstractFrame implements FrameInterface
|
||||||
{
|
{
|
||||||
@@ -48,6 +50,11 @@ class Frame extends AbstractFrame implements FrameInterface
|
|||||||
return $this->core;
|
return $this->core;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSize(): SizeInterface
|
||||||
|
{
|
||||||
|
return new Size(imagesx($this->core), imagesy($this->core));
|
||||||
|
}
|
||||||
|
|
||||||
public function getDelay(): float
|
public function getDelay(): float
|
||||||
{
|
{
|
||||||
return $this->delay;
|
return $this->delay;
|
||||||
|
@@ -20,6 +20,11 @@ class Frame extends AbstractFrame implements FrameInterface
|
|||||||
return $this->core;
|
return $this->core;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSize(): SizeInterface
|
||||||
|
{
|
||||||
|
return new Size($this->core->getImageWidth(), $this->core->getImageHeight());
|
||||||
|
}
|
||||||
|
|
||||||
public function getDelay(): float
|
public function getDelay(): float
|
||||||
{
|
{
|
||||||
return $this->core->getImageDelay() / 100;
|
return $this->core->getImageDelay() / 100;
|
||||||
|
@@ -6,6 +6,7 @@ interface FrameInterface
|
|||||||
{
|
{
|
||||||
public function toImage(): ImageInterface;
|
public function toImage(): ImageInterface;
|
||||||
public function getCore();
|
public function getCore();
|
||||||
|
public function getSize(): SizeInterface;
|
||||||
public function getDelay(): float;
|
public function getDelay(): float;
|
||||||
public function setDelay(float $delay): FrameInterface;
|
public function setDelay(float $delay): FrameInterface;
|
||||||
public function getDispose(): int;
|
public function getDispose(): int;
|
||||||
|
Reference in New Issue
Block a user