Skip to content

Commit 72be1e2

Browse files
authored
Handle alpga for webp is source have alpha (#161)
1 parent ddf9d7b commit 72be1e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/ImageResize.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ public function save($filename, $image_type = null, $quality = null, $permission
267267
$background = imagecolorallocate($dest_image, 255, 255, 255);
268268
imagefilledrectangle($dest_image, 0, 0, $this->getDestWidth(), $this->getDestHeight(), $background);
269269
}
270+
271+
imagealphablending($dest_image, false);
272+
imagesavealpha($dest_image, true);
273+
270274
break;
271275

272276
case IMAGETYPE_PNG:

0 commit comments

Comments
 (0)