1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-16 10:54:02 +02:00

Refactor code

This commit is contained in:
Oliver Vogel
2024-08-04 08:44:12 +02:00
parent 68479181fc
commit 50feb11dce
2 changed files with 7 additions and 5 deletions

View File

@@ -5,7 +5,9 @@ declare(strict_types=1);
namespace Intervention\Image\Drivers\Gd\Encoders;
use GdImage;
use Intervention\Image\Colors\Rgb\Color;
use Intervention\Image\Colors\Rgb\Channels\Blue;
use Intervention\Image\Colors\Rgb\Channels\Green;
use Intervention\Image\Colors\Rgb\Channels\Red;
use Intervention\Image\Drivers\Gd\Cloner;
use Intervention\Image\EncodedImage;
use Intervention\Image\Encoders\PngEncoder as GenericPngEncoder;
@@ -61,9 +63,9 @@ class PngEncoder extends GenericPngEncoder implements SpecializedInterface
// original image with transprency
$blendingIndex = imagecolorallocatealpha(
$output,
$blendingColor->red()->value(),
$blendingColor->green()->value(),
$blendingColor->blue()->value(),
$blendingColor->channel(Red::class)->value(),
$blendingColor->channel(Green::class)->value(),
$blendingColor->channel(Blue::class)->value(),
1,
);

View File

@@ -50,7 +50,7 @@ class PngEncoder extends GenericPngEncoder implements SpecializedInterface
if ($this->indexed === false) {
$output = clone $image->core()->native();
// ensure to encode PNG image type 6 true color alpha
// ensure to encode PNG image type 6 (true color alpha)
$output->setFormat('PNG32');
$output->setImageFormat('PNG32');