Skip to content

Commit ae8f2d7

Browse files
authored
Update MemoryDrawing.php
1 parent a299be3 commit ae8f2d7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/PhpSpreadsheet/Worksheet/MemoryDrawing.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,8 @@ private function cloneResource(): void
101101
// If the image has transparency...
102102
$transparent = imagecolortransparent($this->imageResource);
103103
if ($transparent >= 0) {
104+
// Starting with Php8.0, next function throws rather than return false
104105
$rgb = imagecolorsforindex($this->imageResource, $transparent);
105-
if (empty($rgb)) {
106-
throw new Exception('Could not get image colors');
107-
}
108106

109107
imagesavealpha($clone, true);
110108
$color = imagecolorallocatealpha($clone, $rgb['red'], $rgb['green'], $rgb['blue'], $rgb['alpha']);

0 commit comments

Comments
 (0)