Skip to content

Commit c69531c

Browse files
committed
:octocat: rename QROptionsTrait::$imageBase64 to $outputBase64, deprecate old name and redirect calls
1 parent ae4ba21 commit c69531c

29 files changed

+69
-43
lines changed

docs/API-QROptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Inherited from [`SettingsContainerAbstract`](https://github.com/chillerlan/php-s
3939
| `$outputInterface` | `string\|null` | `null` | * | The FQCN of the custom `QROutputInterface` if `QROptions::$outputType` is set to `QROutputInterface::CUSTOM` |
4040
| `$returnResource` | `bool` | `false` | * | Return the image resource instead of a render if applicable. |
4141
| `$cachefile` | `string\|null` | `null` | * | Optional cache file path |
42-
| `$imageBase64` | `bool` | `true` | * | Toggle base64 or raw image data (if applicable) |
42+
| `$outputBase64` | `bool` | `true` | * | Toggle base64 data URI or raw data output (if applicable) |
4343
| `$eol` | `string` | `PHP_EOL` | * | Newline string (HTML, SVG, TEXT) |
4444
| `$bgColor` | `mixed` | `null` | a valid FPDF, GD or Imagick color value | Sets the image background color (if applicable). QRImagick: defaults to "white", QRGdImage: defaults to [255, 255, 255], QRFpdf: defaults to blank internally (white page) |
4545
| `$drawLightModules` | `bool` | `true` | * | Whether to draw the light (false) modules |

docs/Usage-Advanced-usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ $qrcode->setOptions($options);
126126
Save the QR Code output to `/path/to/qrcode.svg`:
127127

128128
```php
129-
$options->imageBase64 = false;
130-
$options->cachefile = '/path/to/qrcode.svg';
129+
$options->outputBase64 = false;
130+
$options->cachefile = '/path/to/qrcode.svg';
131131

132132
$qrcode->render($data);
133133
```

docs/Usage-Quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Configuration using `QROptions`:
2727

2828
```php
2929
$options = new QROptions;
30-
$options->version = 7;
31-
$options->imageBase64 = false; // output raw image instead of base64 data URI
30+
$options->version = 7;
31+
$options->outputBase64 = false; // output raw image instead of base64 data URI
3232

3333
header('Content-type: image/svg+xml'); // the image type is SVG by default
3434

examples/authenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
$options->version = 7;
3737
$options->addQuietzone = false;
38-
$options->imageBase64 = false;
38+
$options->outputBase64 = false;
3939
$options->svgAddXmlHeader = false;
4040
$options->cssClass = 'my-qrcode';
4141
$options->drawLightModules = false;

examples/fpdf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
$options->fpdfMeasureUnit = 'mm';
2222
$options->bgColor = [222, 222, 222];
2323
$options->drawLightModules = false;
24-
$options->imageBase64 = false;
24+
$options->outputBase64 = false;
2525
$options->moduleValues = [
2626
// finder
2727
QRMatrix::M_FINDER_DARK => [0, 63, 255], // dark (true)

examples/image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
$options->version = 7;
2020
$options->outputType = QROutputInterface::GDIMAGE_PNG;
2121
$options->scale = 20;
22-
$options->imageBase64 = false;
22+
$options->outputBase64 = false;
2323
$options->bgColor = [200, 150, 200];
2424
$options->imageTransparent = true;
2525
#$options->transparencyColor = [233, 233, 233];

examples/imageWithLogo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function dump(string $file = null, string $logo = null):string{
6363

6464
$this->saveToFile($imageData, $file);
6565

66-
if($this->options->imageBase64){
66+
if($this->options->outputBase64){
6767
$imageData = $this->toBase64DataURI($imageData, 'image/'.$this->options->outputType);
6868
}
6969

@@ -80,7 +80,7 @@ public function dump(string $file = null, string $logo = null):string{
8080
$options = new QROptions;
8181

8282
$options->version = 5;
83-
$options->imageBase64 = false;
83+
$options->outputBase64 = false;
8484
$options->scale = 6;
8585
$options->imageTransparent = false;
8686
$options->drawCircularModules = true;

examples/imageWithText.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function dump(string $file = null, string $text = null):string{
4242

4343
$this->saveToFile($imageData, $file);
4444

45-
if($this->options->imageBase64){
45+
if($this->options->outputBase64){
4646
$imageData = $this->toBase64DataURI($imageData, 'image/'.$this->options->outputType);
4747
}
4848

@@ -96,10 +96,10 @@ protected function addText(string $text):void{
9696

9797
$options = new QROptions;
9898

99-
$options->version = 7;
100-
$options->outputType = QROutputInterface::GDIMAGE_PNG;
101-
$options->scale = 3;
102-
$options->imageBase64 = false;
99+
$options->version = 7;
100+
$options->outputType = QROutputInterface::GDIMAGE_PNG;
101+
$options->scale = 3;
102+
$options->outputBase64 = false;
103103

104104

105105
$qrcode = new QRCode($options);

examples/imagick.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
$options->version = 7;
2020
$options->outputType = QROutputInterface::IMAGICK;
2121
$options->scale = 20;
22-
$options->imageBase64 = false;
22+
$options->outputBase64 = false;
2323
$options->bgColor = '#ccccaa';
2424
$options->imageTransparent = true;
2525
#$options->transparencyColor = '#ECF9BE';

examples/imagickWithLogo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function dump(string $file = null):string{
5454
$this->imagick->destroy();
5555
$this->saveToFile($imageData, $file);
5656

57-
if($this->options->imageBase64){
57+
if($this->options->outputBase64){
5858
$imageData = $this->toBase64DataURI($imageData, (new finfo(FILEINFO_MIME_TYPE))->buffer($imageData));
5959
}
6060

@@ -101,7 +101,7 @@ protected function set_pngLogo(string $pngLogo):void{
101101
$options->outputType = QROutputInterface::CUSTOM;
102102
$options->outputInterface = QRImagickWithLogo::class; // use the custom output class
103103
$options->eccLevel = EccLevel::H;
104-
$options->imageBase64 = false;
104+
$options->outputBase64 = false;
105105
$options->addLogoSpace = true;
106106
$options->logoSpaceWidth = 15;
107107
$options->logoSpaceHeight = 15;

0 commit comments

Comments
 (0)