Skip to content

Commit

Permalink
GdImage class objects replace GD
Browse files Browse the repository at this point in the history
Implementing suggestions for:
#1027 (comment)
As explained in:
https://php.watch/versions/8.0/gdimage
  • Loading branch information
lfelizari committed Feb 21, 2021
1 parent d822951 commit 064dba0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Mike42/Escpos/GdEscposImage.php
Expand Up @@ -61,7 +61,7 @@ protected function loadImageData(string $filename = null)
*/
public function readImageFromGdResource($im)
{
if (!is_resource($im) && !is_object($im)) {
if (!is_resource($im) && !$im instanceof \GdImage) {
throw new Exception("Failed to load image.");
} elseif (!EscposImage::isGdLoaded()) {
throw new Exception(__FUNCTION__ . " requires 'gd' extension.");
Expand Down

0 comments on commit 064dba0

Please sign in to comment.