mirror of
https://github.com/Intervention/image.git
synced 2025-08-16 10:54:02 +02:00
Refactor code
This commit is contained in:
@@ -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,
|
||||
);
|
||||
|
||||
|
@@ -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');
|
||||
|
||||
|
Reference in New Issue
Block a user