mirror of
https://github.com/Intervention/image.git
synced 2025-08-11 00:14:03 +02:00
Fix bug
This commit is contained in:
@@ -16,7 +16,7 @@ class ResizeModifier implements ModifierInterface
|
|||||||
|
|
||||||
public function apply(ImageInterface $image): ImageInterface
|
public function apply(ImageInterface $image): ImageInterface
|
||||||
{
|
{
|
||||||
$resizeTo = $image->size()->resize($this->width, $this->height);
|
$resizeTo = $this->getAdjustedSize($image);
|
||||||
|
|
||||||
foreach ($image as $frame) {
|
foreach ($image as $frame) {
|
||||||
$this->resizeFrame($frame, $resizeTo);
|
$this->resizeFrame($frame, $resizeTo);
|
||||||
@@ -25,6 +25,11 @@ class ResizeModifier implements ModifierInterface
|
|||||||
return $image;
|
return $image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getAdjustedSize(ImageInterface $image): SizeInterface
|
||||||
|
{
|
||||||
|
return $image->size()->resize($this->width, $this->height);
|
||||||
|
}
|
||||||
|
|
||||||
protected function resizeFrame(FrameInterface $frame, SizeInterface $resizeTo): void
|
protected function resizeFrame(FrameInterface $frame, SizeInterface $resizeTo): void
|
||||||
{
|
{
|
||||||
// create new image
|
// create new image
|
||||||
|
Reference in New Issue
Block a user