Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Aug 4, 2024
1 parent 6847918 commit 50feb11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/Drivers/Gd/Encoders/PngEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
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;
Expand Down Expand Up @@ -61,9 +63,9 @@ private function prepareOutput(ImageInterface $image): GdImage
// 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,
);

Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Imagick/Encoders/PngEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private function prepareOutput(ImageInterface $image): Imagick
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');

Expand Down

0 comments on commit 50feb11

Please sign in to comment.