Come and see if you have developed SAE.

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.