----------------------------------------------------------------------
($intext, $outfile = false,$saveandprint=false)
| 478 | |
| 479 | //---------------------------------------------------------------------- |
| 480 | public function encodePNG($intext, $outfile = false,$saveandprint=false) |
| 481 | { |
| 482 | try { |
| 483 | |
| 484 | ob_start(); |
| 485 | $tab = $this->encode($intext); |
| 486 | $err = ob_get_contents(); |
| 487 | ob_end_clean(); |
| 488 | |
| 489 | if ($err != '') |
| 490 | QRtools::log($outfile, $err); |
| 491 | |
| 492 | $maxSize = (int)(QR_PNG_MAXIMUM_SIZE / (count($tab)+2*$this->margin)); |
| 493 | |
| 494 | QRimage::png($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin,$saveandprint); |
| 495 | |
| 496 | } catch (Exception $e) { |
| 497 | |
| 498 | QRtools::log($outfile, $e->getMessage()); |
| 499 | |
| 500 | } |
| 501 | } |
| 502 | } |