mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-16 13:06:31 +00:00
Update MemoryDrawing.php
This commit is contained in:
@@ -101,10 +101,8 @@ class MemoryDrawing extends BaseDrawing
|
||||
// If the image has transparency...
|
||||
$transparent = imagecolortransparent($this->imageResource);
|
||||
if ($transparent >= 0) {
|
||||
// Starting with Php8.0, next function throws rather than return false
|
||||
$rgb = imagecolorsforindex($this->imageResource, $transparent);
|
||||
if (empty($rgb)) {
|
||||
throw new Exception('Could not get image colors');
|
||||
}
|
||||
|
||||
imagesavealpha($clone, true);
|
||||
$color = imagecolorallocatealpha($clone, $rgb['red'], $rgb['green'], $rgb['blue'], $rgb['alpha']);
|
||||
|
||||
Reference in New Issue
Block a user