From 4878636a4ab3e8c5c7f0442eab1f1daf2631e4ad Mon Sep 17 00:00:00 2001 From: Yakeing Date: Tue, 27 Aug 2019 13:04:40 +0800 Subject: [PATCH] add output QG object --- src/QrCode.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/QrCode.php b/src/QrCode.php index b9e95b1..2240ff0 100644 --- a/src/QrCode.php +++ b/src/QrCode.php @@ -36,10 +36,12 @@ public static function image($text, $pixel = 200, $icon = false, $distinguish = $exchange = new qrcode_exchange(); $masked = $exchange->run($string, $width, $frame, $datacode); $tab = $exchange->binarize($masked); + if(is_array($stream)) return $tab; //image 图像 - if(true === $stream) return $tab; $img = new qrcode_image(); $im = $img->ImgColor($tab, $pixel, $icon, $margin, $color); + if(true === $stream) return $im; + //if(is_object($stream)) return $im; //new stdClass() if(strtoupper($type) == 'PNG'){ header('Content-type: image/PNG'); ImagePNG($im); @@ -48,6 +50,7 @@ public static function image($text, $pixel = 200, $icon = false, $distinguish = ImageJPEG($im);//合成输出 } ImageDestroy($im); //结束图形 + return $im; } }//END class qrcode