Skip to content

Commit

Permalink
add output QG object
Browse files Browse the repository at this point in the history
  • Loading branch information
yakeing authored Aug 27, 2019
1 parent 4041986 commit 4878636
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/QrCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -48,6 +50,7 @@ public static function image($text, $pixel = 200, $icon = false, $distinguish =
ImageJPEG($im);//合成输出
}
ImageDestroy($im); //结束图形
return $im;
}
}//END class qrcode

Expand Down

0 comments on commit 4878636

Please sign in to comment.