<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use BaconQrCode\Encoder\Encoder; use ModStart\Core\Exception\BizException; use ModStart\ModStart; class QrcodeUtil { public static function png($Afv_G, $NVUsK = 200) { goto BDaBA; MvOOQ: return $AZQ8A->writeString($Afv_G, 'UTF-8'); goto imrvH; BDaBA: if (class_exists(\BaconQrCode\Renderer\Image\Png::class)) { goto z6d5W; gL43N: $k8Sly->setWidth($NVUsK); goto GoHBX; nPxgj: $k8Sly->setMargin(0); goto lNiGI; z6d5W: $k8Sly = new \BaconQrCode\Renderer\Image\Png(); goto nPxgj; lNiGI: $k8Sly->setHeight($NVUsK); goto gL43N; GoHBX: } else { BizException::throwsIf('Please Install imagick extension', !extension_loaded('imagick')); $k8Sly = new \BaconQrCode\Renderer\ImageRenderer(new \BaconQrCode\Renderer\RendererStyle\RendererStyle(400), new \BaconQrCode\Renderer\Image\ImagickImageBackEnd()); } goto st26r; st26r: $AZQ8A = new \BaconQrCode\Writer($k8Sly); goto MvOOQ; imrvH: } public static function pngBase64String($Afv_G, $NVUsK = 200) { return 'data:image/png;base64,' . base64_encode(self::png($Afv_G, $NVUsK)); } }