Skip to content

Commit

Permalink
Webp opening support added to SimpleImage
Browse files Browse the repository at this point in the history
  • Loading branch information
floor12 committed Mar 27, 2020
1 parent b672c6a commit 8efbf08
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/SimpleImage.php
Expand Up @@ -27,6 +27,8 @@ function load($filename)
$this->image = imagecreatefromgif($filename);
} elseif ($this->image_type == IMAGETYPE_PNG) {
$this->image = imagecreatefrompng($filename);
} elseif ($this->image_type == IMAGETYPE_WEBP) {
$this->image = imagecreatefromwebp($filename);
}
}

Expand Down Expand Up @@ -154,4 +156,4 @@ public function watermark($path)
imagecopyresampled($this->image, $new_stamp, imagesx($this->image) - $stamp_new_width - $marge_right, imagesy($this->image) - $stamp_new_height - $marge_bottom, 0, 0, $stamp_new_width, $stamp_new_height, $stamp_new_width, $stamp_new_height);

}
}
}

0 comments on commit 8efbf08

Please sign in to comment.