mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-30 03:58:28 +00:00
:octocat: rename QROptionsTrait::$imageBase64 to $outputBase64, deprecate old name and redirect calls
This commit is contained in:
@@ -35,7 +35,7 @@ $options->algorithm = AuthenticatorInterface::ALGO_SHA512;
|
||||
*/
|
||||
$options->version = 7;
|
||||
$options->addQuietzone = false;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
$options->svgAddXmlHeader = false;
|
||||
$options->cssClass = 'my-qrcode';
|
||||
$options->drawLightModules = false;
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ $options->scale = 5;
|
||||
$options->fpdfMeasureUnit = 'mm';
|
||||
$options->bgColor = [222, 222, 222];
|
||||
$options->drawLightModules = false;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
$options->moduleValues = [
|
||||
// finder
|
||||
QRMatrix::M_FINDER_DARK => [0, 63, 255], // dark (true)
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ $options = new QROptions;
|
||||
$options->version = 7;
|
||||
$options->outputType = QROutputInterface::GDIMAGE_PNG;
|
||||
$options->scale = 20;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
$options->bgColor = [200, 150, 200];
|
||||
$options->imageTransparent = true;
|
||||
#$options->transparencyColor = [233, 233, 233];
|
||||
|
||||
@@ -63,7 +63,7 @@ class QRImageWithLogo extends QRGdImage{
|
||||
|
||||
$this->saveToFile($imageData, $file);
|
||||
|
||||
if($this->options->imageBase64){
|
||||
if($this->options->outputBase64){
|
||||
$imageData = $this->toBase64DataURI($imageData, 'image/'.$this->options->outputType);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class QRImageWithLogo extends QRGdImage{
|
||||
$options = new QROptions;
|
||||
|
||||
$options->version = 5;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
$options->scale = 6;
|
||||
$options->imageTransparent = false;
|
||||
$options->drawCircularModules = true;
|
||||
|
||||
@@ -42,7 +42,7 @@ class QRImageWithText extends QRGdImage{
|
||||
|
||||
$this->saveToFile($imageData, $file);
|
||||
|
||||
if($this->options->imageBase64){
|
||||
if($this->options->outputBase64){
|
||||
$imageData = $this->toBase64DataURI($imageData, 'image/'.$this->options->outputType);
|
||||
}
|
||||
|
||||
@@ -96,10 +96,10 @@ class QRImageWithText extends QRGdImage{
|
||||
|
||||
$options = new QROptions;
|
||||
|
||||
$options->version = 7;
|
||||
$options->outputType = QROutputInterface::GDIMAGE_PNG;
|
||||
$options->scale = 3;
|
||||
$options->imageBase64 = false;
|
||||
$options->version = 7;
|
||||
$options->outputType = QROutputInterface::GDIMAGE_PNG;
|
||||
$options->scale = 3;
|
||||
$options->outputBase64 = false;
|
||||
|
||||
|
||||
$qrcode = new QRCode($options);
|
||||
|
||||
@@ -19,7 +19,7 @@ $options = new QROptions;
|
||||
$options->version = 7;
|
||||
$options->outputType = QROutputInterface::IMAGICK;
|
||||
$options->scale = 20;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
$options->bgColor = '#ccccaa';
|
||||
$options->imageTransparent = true;
|
||||
#$options->transparencyColor = '#ECF9BE';
|
||||
|
||||
@@ -54,7 +54,7 @@ class QRImagickWithLogo extends QRImagick{
|
||||
$this->imagick->destroy();
|
||||
$this->saveToFile($imageData, $file);
|
||||
|
||||
if($this->options->imageBase64){
|
||||
if($this->options->outputBase64){
|
||||
$imageData = $this->toBase64DataURI($imageData, (new finfo(FILEINFO_MIME_TYPE))->buffer($imageData));
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ $options->version = 5;
|
||||
$options->outputType = QROutputInterface::CUSTOM;
|
||||
$options->outputInterface = QRImagickWithLogo::class; // use the custom output class
|
||||
$options->eccLevel = EccLevel::H;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
$options->addLogoSpace = true;
|
||||
$options->logoSpaceWidth = 15;
|
||||
$options->logoSpaceHeight = 15;
|
||||
|
||||
@@ -19,7 +19,7 @@ mb_internal_encoding('UTF-8');
|
||||
|
||||
// please excuse the IDE yelling https://youtrack.jetbrains.com/issue/WI-66549
|
||||
$options = new QROptions;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
$options->connectPaths = true;
|
||||
|
||||
$qrcode = (new QRCode($options))
|
||||
|
||||
@@ -67,7 +67,7 @@ try{
|
||||
'moduleValues' => $moduleValues,
|
||||
'outputType' => $_POST['output_type'],
|
||||
'scale' => (int)$_POST['scale'],
|
||||
'imageBase64' => true,
|
||||
'outputBase64' => true,
|
||||
'imageTransparent' => false,
|
||||
]);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ require_once __DIR__.'/../vendor/autoload.php';
|
||||
$options = new QROptions;
|
||||
|
||||
$options->outputType = QROutputInterface::MARKUP_SVG;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
$options->svgAddXmlHeader = false;
|
||||
$options->connectPaths = true;
|
||||
$options->drawCircularModules = false;
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ $options = new QROptions;
|
||||
|
||||
$options->version = 7;
|
||||
$options->outputType = QROutputInterface::MARKUP_SVG;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
// if set to false, the light modules won't be rendered
|
||||
$options->drawLightModules = true;
|
||||
// empty the default value to remove the fill* and opacity* attributes from the <path> elements
|
||||
|
||||
@@ -256,7 +256,7 @@ $options->meltRadius = 0.4;
|
||||
$options->version = 7;
|
||||
$options->outputType = QROutputInterface::CUSTOM;
|
||||
$options->outputInterface = MeltedSVGQRCodeOutput::class;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
$options->addQuietzone = true;
|
||||
$options->eccLevel = EccLevel::H;
|
||||
$options->addLogoSpace = true;
|
||||
|
||||
@@ -135,7 +135,7 @@ $options->outputInterface = RandomDotsSVGOutput::class;
|
||||
$options->version = 5;
|
||||
$options->eccLevel = EccLevel::H;
|
||||
$options->addQuietzone = true;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
$options->drawLightModules = false;
|
||||
$options->connectPaths = true;
|
||||
$options->excludeFromConnect = [
|
||||
|
||||
@@ -65,7 +65,7 @@ class RoundQuietzoneSVGoutput extends QRMarkupSVG{
|
||||
$svg .= sprintf('%1$s</svg>%1$s', $this->options->eol);
|
||||
|
||||
// transform to data URI only when not saving to file
|
||||
if(!$saveToFile && $this->options->imageBase64){
|
||||
if(!$saveToFile && $this->options->outputBase64){
|
||||
$svg = $this->toBase64DataURI($svg, 'image/svg+xml');
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ $options->svgLogoCssClass = 'logo';
|
||||
$options->version = 7;
|
||||
$options->eccLevel = EccLevel::H;
|
||||
$options->addQuietzone = false; // we're not adding a quiet zone, this is done internally in our own module
|
||||
$options->imageBase64 = false; // avoid base64 URI output for the example
|
||||
$options->outputBase64 = false; // avoid base64 URI output for the example
|
||||
$options->outputType = QROutputInterface::CUSTOM;
|
||||
$options->outputInterface = RoundQuietzoneSVGoutput::class; // load our own output class
|
||||
$options->drawLightModules = false; // set to true to add the light modules
|
||||
|
||||
@@ -115,7 +115,7 @@ $options->svgLogoCssClass = 'dark';
|
||||
$options->version = 5;
|
||||
$options->outputType = QROutputInterface::CUSTOM;
|
||||
$options->outputInterface = QRSvgWithLogo::class;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
$options->eccLevel = EccLevel::H; // ECC level H is necessary when using logos
|
||||
$options->addQuietzone = true;
|
||||
$options->drawLightModules = true;
|
||||
|
||||
@@ -171,7 +171,7 @@ $options->version = 5;
|
||||
$options->quietzoneSize = 4;
|
||||
$options->outputType = QROutputInterface::CUSTOM;
|
||||
$options->outputInterface = QRSvgWithLogoAndCustomShapes::class;
|
||||
$options->imageBase64 = false;
|
||||
$options->outputBase64 = false;
|
||||
$options->eccLevel = EccLevel::H; // ECC level H is required when using logos
|
||||
$options->addQuietzone = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user