After SAE development, let's take a look at this post. at the end, lzgctgc generated a QR code written by QRCode at 2014-12-0909: 41: 03 and added the logo locally. When the QR code is successfully generated on the SAE, but the logo is not followed, is it not supported on the SAE: imagecopyresampled function. Function & nbsp; has been developed by SAE.
This post was last edited by lzgctgc at 09:41:03
I used a QR code written in QRCode to generate the code, and added the logo to generate the code locally. When the QR code is successfully generated on the SAE, but the logo is not followed, is it not supported on the SAE: imagecopyresampled function.
function Build_SAEQrcode($filename = '', $text='', $size='8', $logo = false){
$return = false;
$level='H';
$padding=1;
$path = 'saestor://uploads/direwm/';
$QR = $path.$filename.".png";
vendor("phpqrcode.qrlib");
QRcode::png($text,$QR, $level, $size,$padding);
if($logo === true){
$QR = imagecreatefromstring(file_get_contents($QR));
$logocontext = imagecreatefromstring(file_get_contents('./uploads/logo.png'));
$QR_width = imagesx($QR);
$QR_height = imagesy($QR);
$logo_width = imagesx($logocontext);
$logo_height = imagesy($logocontext);
$logo_qr_width = $QR_width / 5;
$scale = $logo_width / $logo_qr_width;
$logo_qr_height = $logo_height / $scale;
$from_width = ($QR_width - $logo_qr_width) / 2;
$return = imagecopyresampled($QR, $logocontext, $from_width, $from_width, 0, 0, $logo_qr_width, $logo_qr_height, $logo_width, $logo_height);
header("Content-Type:image/png");
imagepng($QR, $path.$filename.".png");
}else $return = true;
imagedestroy($QR);
return $return;
}
------ Solution ----------------------
I used it before. later, I gave up because he didn't allow me to use it for free.
Imagepng ($ QR, $ path. $ filename. ". png ");
Yes, it is definitely not supported, because the conventional file system is unavailable. However, you can remove the file name ($ path. $ filename. ". png ").
Whether file_get_contents is still in use. it has not been tested. you are not sure.