1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-17 04:08:14 +01:00

Refactor code

This commit is contained in:
Oliver Vogel 2024-08-05 16:38:16 +02:00
parent ce4d2bc75c
commit 839bc6a3c6
No known key found for this signature in database
GPG Key ID: 1B19D214C02D69BB

View File

@ -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());