MCPcopy Create free account
hub / github.com/codemistic/Web-Development / encodePNG

Method encodePNG

text-to-qr/lib/phpqrcode/phpqrcode.php:3288–3309  ·  view source on GitHub ↗

----------------------------------------------------------------------

($intext, $outfile = false,$saveandprint=false)

Source from the content-addressed store, hash-verified

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

Callers 1

pngMethod · 0.45

Calls 4

encodeMethod · 0.95
countFunction · 0.85
logMethod · 0.45
pngMethod · 0.45

Tested by

no test coverage detected