Skip to content

Commit

Permalink
Exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
octoberapp committed Jul 24, 2023
1 parent 28d28f4 commit ffa599f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Resize/Resizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ public static function open($file): Resizer
*/
protected function retainImageTransparency($img)
{
if (!$img) {
return;
}

if ($this->mime === 'image/gif') {
$alphaColor = ['red' => 0, 'green' => 0, 'blue' => 0];
$alphaIndex = imagecolortransparent($img);
Expand Down

0 comments on commit ffa599f

Please sign in to comment.