From 55978122739bb8bd1f696a2df18665266f290182 Mon Sep 17 00:00:00 2001 From: smiley Date: Tue, 5 Sep 2023 03:05:49 +0200 Subject: [PATCH] :shower: --- examples/Readme.md | 4 ++++ examples/image.php | 4 ++-- src/QROptionsTrait.php | 3 ++- tests/Data/QRDataTest.php | 2 ++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/Readme.md b/examples/Readme.md index 5ab27522a..150bab173 100644 --- a/examples/Readme.md +++ b/examples/Readme.md @@ -26,8 +26,12 @@ - [SVG with a round shape and randomly filled quiet zone](./svgRoundQuietzone.php): example similar to the QR Codes of a certain vendor ([#137](https://github.com/chillerlan/php-qrcode/discussions/137)) - [SVG with logo, custom module shapes and custom finder patterns](./svgWithLogoAndCustomShapes.php): module- and finder pattern customization ([#150](https://github.com/chillerlan/php-qrcode/discussions/150)) + ## Other examples - [Authenticator](./authenticator.php): create a QR Code that displays an URI for a mobile authenticator (featuring [`chillerlan/php-authenticator`](https://github.com/chillerlan/php-authenticator)) - [Interactive output](./qrcode-interactive.php): interactive demo (via [index.html](./index.html)) - [Custom module shapes](./shapes.svg): SVG paths to customize the module shapes ([#150](https://github.com/chillerlan/php-qrcode/discussions/150)) + + +Please note that the examples are self-contained, meaning that all custom classes are defined in an example file, so they don't necessarily respect the PSR-4 one file = one class principle. diff --git a/examples/image.php b/examples/image.php index 8fa29778c..7dcb00f72 100644 --- a/examples/image.php +++ b/examples/image.php @@ -62,10 +62,10 @@ $options->moduleValues = [ ]; -$im = (new QRCode($options))->render('https://www.youtube.com/watch?v=dQw4w9WgXcQ'); +$out = (new QRCode($options))->render('https://www.youtube.com/watch?v=dQw4w9WgXcQ'); header('Content-type: image/png'); -echo $im; +echo $out; exit; diff --git a/src/QROptionsTrait.php b/src/QROptionsTrait.php index fa73b73f4..f0a105b99 100644 --- a/src/QROptionsTrait.php +++ b/src/QROptionsTrait.php @@ -205,7 +205,8 @@ trait QROptionsTrait{ * Module values map * * - QRImagick, QRMarkupHTML, QRMarkupSVG: #ABCDEF, cssname, rgb(), rgba()... - * - QREps, QRFpdf, QRGdImage: [63, 127, 255] // R, G, B + * - QREps, QRFpdf, QRGdImage: [R, G, B] // 0-255 + * - QREps: [C, M, Y, K] // 0-255 */ protected ?array $moduleValues = null; diff --git a/tests/Data/QRDataTest.php b/tests/Data/QRDataTest.php index be526f694..bd2984768 100644 --- a/tests/Data/QRDataTest.php +++ b/tests/Data/QRDataTest.php @@ -14,6 +14,7 @@ use chillerlan\QRCode\Common\BitBuffer; use chillerlan\QRCode\Common\MaskPattern; use chillerlan\QRCode\Data\QRData; use chillerlan\QRCode\Output\QRGdImage; +use chillerlan\QRCode\Output\QROutputInterface; use chillerlan\QRCode\QRCode; use chillerlan\QRCode\QROptions; use PHPUnit\Framework\TestCase; @@ -50,6 +51,7 @@ final class QRDataTest extends TestCase{ $this::assertSame(3, $matrix->getVersion()->getVersionNumber()); // attempt to read + $options->outputType = QROutputInterface::GDIMAGE_PNG; $options->outputBase64 = false; $options->readerUseImagickIfAvailable = false;