"", "redondancy" => DEFAULT_REDONDANCY, "margin" => DEFAULT_MARGIN, "size" => DEFAULT_SIZE, "bgColor" => DEFAULT_BGCOLOR, "mainColor" => DEFAULT_MAINCOLOR, ); $validFormSubmitted = false; if ( isset($_POST['txt']) AND isset($_POST['redondancy']) AND isset($_POST['margin']) AND isset($_POST['size']) AND isset($_POST['bgColor']) AND isset($_POST['mainColor']) ) { if (strlen($_POST['txt']) >= 1 AND strlen($_POST['txt']) <= 4096) $params['txt'] = $_POST['txt']; else exit("Wrong value for txt"); if ($_POST['redondancy'] === "low" OR $_POST['redondancy'] === "medium" OR $_POST['redondancy'] === "quartile" OR $_POST['redondancy'] === "high") $params['redondancy'] = $_POST['redondancy']; else exit("Wrong value for redondancy"); if (is_numeric($_POST['margin']) AND $_POST['margin'] >= 0 AND $_POST['margin'] <= 1024) $params['margin'] = $_POST['margin']; else if (empty($_POST['margin'])) $params['margin'] = NULL; else exit("Wrong value for margin"); if (is_numeric($_POST['size']) AND $_POST['size'] >= 1 AND $_POST['size'] <= 4096) $params['size'] = $_POST['size']; else if (empty($_POST['size'])) $params['size'] = NULL; else exit("Wrong value for size"); if (preg_match("/^#[abcdefABCDEF0-9]{6}$/", $_POST['bgColor'])) $params['bgColor'] = substr($_POST['bgColor'], -6); else exit("Wrong value for bgColor"); if (preg_match("/^#[abcdefABCDEF0-9]{6}$/", $_POST['mainColor'])) $params['mainColor'] = substr($_POST['mainColor'], -6); else exit("Wrong value for mainColor"); $validFormSubmitted = true; } ?> LibreQR ยท <?= $loc['subtitle'] ?> 'css/', 'compress' => true); $cssFileName = Less_Cache::Get(array("style.less" => ""), $options, $colorScheme); ?> ' . "\n"; } ?>

LibreQR

hexdec(substr($params['bgColor'],0,2)), 'g' => hexdec(substr($params['bgColor'],2,2)), 'b' => hexdec(substr($params['bgColor'],4,2)), ); require "barcode-generator/Utils/QrCode.php"; $qrCode = new QrCode(); if (!is_null($params['margin'])) $qrCode->setPadding($params['margin']); $qrCode ->setText($params['txt']) ->setSize($params['size']) ->setErrorCorrection($params['redondancy']) ->setForegroundColor(array( 'r' => hexdec(substr($params['mainColor'],0,2)), 'g' => hexdec(substr($params['mainColor'],2,2)), 'b' => hexdec(substr($params['mainColor'],4,2)), )) ->setBackgroundColor($rgbBgColor) ->setImageType(QrCode::IMAGE_TYPE_PNG); $dataUri = $qrCode->getDataUri(); $qrSize = $qrCode->getSize() + 2 * $qrCode->getPadding(); ?>