Fix transparency not handled when loading images

This commit is contained in:
Giuseppe Criscione 2019-11-15 23:51:41 +01:00
parent 140e5f8793
commit 962ed5e427

View File

@ -672,10 +672,12 @@ class Image extends File
break;
case 'image/png':
$this->image = imagecreatefrompng($this->path);
$this->enableTransparency($this->image);
break;
case 'image/gif':
$this->image = imagecreatefromgif($this->path);
imagepalettetotruecolor($this->image);
$this->enableTransparency($this->image);
break;
default:
throw new RuntimeException('Unsupported image MIME type');