----------------------------------------------------------------------
($intext, $outfile = false,$saveandprint=false)
| 3286 | |
| 3287 | //---------------------------------------------------------------------- |
| 3288 | public function encodePNG($intext, $outfile = false,$saveandprint=false) |
| 3289 | { |
| 3290 | try { |
| 3291 | |
| 3292 | ob_start(); |
| 3293 | $tab = $this->encode($intext); |
| 3294 | $err = ob_get_contents(); |
| 3295 | ob_end_clean(); |
| 3296 | |
| 3297 | if ($err != '') |
| 3298 | QRtools::log($outfile, $err); |
| 3299 | |
| 3300 | $maxSize = (int)(QR_PNG_MAXIMUM_SIZE / (count($tab)+2*$this->margin)); |
| 3301 | |
| 3302 | QRimage::png($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin,$saveandprint); |
| 3303 | |
| 3304 | } catch (Exception $e) { |
| 3305 | |
| 3306 | QRtools::log($outfile, $e->getMessage()); |
| 3307 | |
| 3308 | } |
| 3309 | } |
| 3310 | } |
| 3311 | |
| 3312 |