mirror of
https://github.com/Intervention/image.git
synced 2025-01-17 04:08:14 +01:00
Refactor code
This commit is contained in:
parent
ce4d2bc75c
commit
839bc6a3c6
@ -50,10 +50,7 @@ class Cloner
|
||||
ColorInterface $background = new Color(255, 255, 255, 0)
|
||||
): GdImage {
|
||||
// define size
|
||||
$size = match (true) {
|
||||
is_null($size) => new Rectangle(imagesx($gd), imagesy($gd)),
|
||||
default => $size,
|
||||
};
|
||||
$size = $size ? $size : new Rectangle(imagesx($gd), imagesy($gd));
|
||||
|
||||
// create new gd image with same size or new given size
|
||||
$clone = imagecreatetruecolor($size->width(), $size->height());
|
||||
|
Loading…
x
Reference in New Issue
Block a user