Skip to content

Commit

Permalink
Fix transparency handling for webp
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsn committed Sep 28, 2020
1 parent e7bb006 commit 0db24cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/Images/Handlers/GDHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ protected function process(string $action)

$dest = $create($this->width, $this->height);

if ($this->image()->imageType === IMAGETYPE_PNG) // png we can actually preserve transparency
// for png and webp we can actually preserve transparency
if (in_array($this->image()->imageType, [IMAGETYPE_PNG, IMAGETYPE_WEBP], true))
{
imagealphablending($dest, false);
imagesavealpha($dest, true);
Expand Down

0 comments on commit 0db24cb

Please sign in to comment.