Ejemplo n.º 1
0
 public function encodePNG($intext, $outfile = false, $saveandprint = false)
 {
     try {
         ob_start();
         $tab = $this->encode($intext);
         $err = ob_get_contents();
         ob_end_clean();
         if ($err != '') {
             wechat_qrcode_QRtools::log($outfile, $err);
         }
         $maxSize = (int) (QR_PNG_MAXIMUM_SIZE / (count($tab) + 2 * $this->margin));
         wechat_qrcode_QRimage::png($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin, $saveandprint);
     } catch (Exception $e) {
         wechat_qrcode_QRtools::log($outfile, $e->getMessage());
     }
 }