Skip to content

Commit

Permalink
Merge pull request #240 from fabio-ivona/patch-1
Browse files Browse the repository at this point in the history
Allow lossless saving of Webp with the GD driver.
  • Loading branch information
timvandijck authored Mar 4, 2024
2 parents 9d76f45 + c2ba96e commit 72ce047
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Drivers/Gd/GdDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ public function save(?string $path = null): static
imagegif($this->image, $path);
break;
case 'webp':
imagewebp($this->image, $path, $this->quality);
$quality = $this->quality === 100 ? IMG_WEBP_LOSSLESS : $this->quality;
imagewebp($this->image, $path, $quality);
break;
case 'avif':
imageavif($this->image, $path, $this->quality);
Expand Down

0 comments on commit 72ce047

Please sign in to comment.