This commit is contained in:
smiley
2026-06-02 14:48:18 +02:00
parent 994ee1d701
commit f94b30dd8e
5 changed files with 22 additions and 20 deletions
+1 -2
View File
@@ -1,6 +1,6 @@
# chillerlan/php-qrcode # chillerlan/php-qrcode
A PHP QR Code generator based on the [implementation by Kazuhiko Arase](https://github.com/kazuhikoarase/qrcode-generator), namespaced, cleaned up, improved and other stuff. <br> A PHP QR Code generator based on the [implementation by Kazuhiko Arase](https://github.com/kazuhikoarase/qrcode-generator), namespaced, cleaned up, improved and other stuff.
It also features a QR Code reader based on a [PHP port](https://github.com/khanamiryan/php-qrcode-detector-decoder) of the [ZXing library](https://github.com/zxing/zxing). It also features a QR Code reader based on a [PHP port](https://github.com/khanamiryan/php-qrcode-detector-decoder) of the [ZXing library](https://github.com/zxing/zxing).
**Attention:** there is now also a javascript port on NPM: [@chillerlan/qrcode](https://www.npmjs.com/package/@chillerlan/qrcode). **Attention:** there is now also a javascript port on NPM: [@chillerlan/qrcode](https://www.npmjs.com/package/@chillerlan/qrcode).
@@ -74,7 +74,6 @@ For the QR Code reader, either `ext-gd` or `ext-imagick` is required!
- Benchmark results can be found in the [`benchmark` branch](https://github.com/chillerlan/php-qrcode/tree/benchmark/markdown) - Benchmark results can be found in the [`benchmark` branch](https://github.com/chillerlan/php-qrcode/tree/benchmark/markdown)
**Important: Please use the examples from the branch that matches your installed php-qrcode version ( **Important: Please use the examples from the branch that matches your installed php-qrcode version (
[v4.x](https://github.com/chillerlan/php-qrcode/tree/v4.3.x/examples),
[v5.x](https://github.com/chillerlan/php-qrcode/tree/v5.0.x/examples), [v5.x](https://github.com/chillerlan/php-qrcode/tree/v5.0.x/examples),
[v6.x](https://github.com/chillerlan/php-qrcode/tree/v6.0.x/examples), [v6.x](https://github.com/chillerlan/php-qrcode/tree/v6.0.x/examples),
[dev-main](https://github.com/chillerlan/php-qrcode/tree/main/examples) [dev-main](https://github.com/chillerlan/php-qrcode/tree/main/examples)
+9 -7
View File
@@ -48,7 +48,7 @@ alternatively you can just pass the letters L/M/Q/H (case-insensitive) to the ma
## maskPattern ## maskPattern
Mask Pattern to use (no value in using, mostly for unit testing purposes) Mask Pattern to use (no value in using, mostly for unit testing purposes, will cause unreadable symbols)
`0 ... 7` or `MaskPattern::PATTERN_AUTO` (default) `0 ... 7` or `MaskPattern::PATTERN_AUTO` (default)
@@ -84,7 +84,7 @@ The FQCN of the `QROutputInterface` to use
Return the image resource instead of a render if applicable. Return the image resource instead of a render if applicable.
- `QRGdImage`: `resource` (PHP < 8), `GdImage` - `QRGdImage`: `GdImage`
- `QRImagick`: `Imagick` - `QRImagick`: `Imagick`
- `QRFpdf`: `FPDF` - `QRFpdf`: `FPDF`
@@ -432,22 +432,24 @@ Sets an optional XSLT stylesheet in the XML output
## readerUseImagickIfAvailable ## readerUseImagickIfAvailable
Use Imagick (if available) when reading QR Codes Use Imagick when reading QR Codes.
Enables Imagick for the QR Code reader if the extension is available.
## readerGrayscale ## readerGrayscale
Grayscale the image before reading Grayscale the image before reading.
## readerInvertColors ## readerInvertColors
Invert the colors of the image Invert the colors of the image.
## readerIncreaseContrast ## readerIncreaseContrast
Increase the contrast before reading Increase the contrast before reading.
note that applying contrast works different in GD and Imagick, so mileage may vary Note that applying contrast works different in GD and Imagick, so mileage may vary.
+4 -4
View File
@@ -82,10 +82,10 @@ The PHP built-in extensions [GdImage](https://www.php.net/manual/book.image.php)
| version | branch/tag | PHP | supported | required extensions | optional extensions | info | | version | branch/tag | PHP | supported | required extensions | optional extensions | info |
|---------|----------------------------------------------------------------------|------------------|-----------|---------------------|------------------------------------------------------------------------------------|---------------------------| |---------|----------------------------------------------------------------------|------------------|-----------|---------------------|------------------------------------------------------------------------------------|---------------------------|
| **v7** | [`dev-main`](https://github.com/chillerlan/php-qrcode/tree/main) | `^8.4` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | | | **v7** | [`dev-main`](https://github.com/chillerlan/php-qrcode/tree/main) | `^8.4` | - | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | |
| **v6** | [`6.0.0`](https://github.com/chillerlan/php-qrcode/tree/v6.0.x) | `^8.2` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | | | **v6** | [`6.x`](https://github.com/chillerlan/php-qrcode/tree/v6.0.x) | `^8.2` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | |
| **v5** | [`5.0.5`](https://github.com/chillerlan/php-qrcode/tree/v5.0.x) | `^7.4 \|\| ^8.0` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | | | **v5** | [`5.x`](https://github.com/chillerlan/php-qrcode/tree/v5.0.x) | `^7.4 \|\| ^8.0` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | |
| **v4** | [`4.3.4`](https://github.com/chillerlan/php-qrcode/tree/v4.3.x) | `^7.4 \|\| ^8.0` | no | `gd`, `mbstring` | `imagick` | | | **v4** | [`4.4.2`](https://github.com/chillerlan/php-qrcode/tree/v4.3.x) | `^7.4 \|\| ^8.0` | no | `gd`, `mbstring` | `imagick` | |
| **v3** | [`3.4.1`](https://github.com/chillerlan/php-qrcode/tree/v3.2.x) | `^7.2` | no | `gd`, `mbstring` | `imagick` | v3.4.1 also supports PHP8 | | **v3** | [`3.4.1`](https://github.com/chillerlan/php-qrcode/tree/v3.2.x) | `^7.2` | no | `gd`, `mbstring` | `imagick` | v3.4.1 also supports PHP8 |
| **v2** | [`2.0.8`](https://github.com/chillerlan/php-qrcode/tree/v2.0.x) | `>=7.0.3` | no | `gd`, `mbstring` | | | | **v2** | [`2.0.8`](https://github.com/chillerlan/php-qrcode/tree/v2.0.x) | `>=7.0.3` | no | `gd`, `mbstring` | | |
| **v1** | [`1.0.9`](https://github.com/chillerlan/php-qrcode/tree/v2.0.x-php5) | `>=5.6` | no | `gd`, `mbstring` | | please let PHP 5 die! | | **v1** | [`1.0.9`](https://github.com/chillerlan/php-qrcode/tree/v2.0.x-php5) | `>=5.6` | no | `gd`, `mbstring` | | please let PHP 5 die! |
+1 -1
View File
@@ -20,7 +20,7 @@ $content = [
$reflectionClass = new ReflectionClass(QROptions::class); $reflectionClass = new ReflectionClass(QROptions::class);
foreach($reflectionClass->getProperties(ReflectionProperty::IS_PROTECTED) as $reflectionProperty){ foreach($reflectionClass->getProperties(ReflectionProperty::IS_PROTECTED|ReflectionProperty::IS_PUBLIC) as $reflectionProperty){
$docblock = $reflectionProperty->getDocComment(); $docblock = $reflectionProperty->getDocComment();
// don't document deprecated settings // don't document deprecated settings
+7 -6
View File
@@ -19,8 +19,9 @@ use function extension_loaded;
trait QRCodeReaderOptionsTrait{ trait QRCodeReaderOptionsTrait{
/** /**
* Use Imagick (if available) when reading QR Codes, * Use Imagick when reading QR Codes.
* enables Imagick for the QR Code reader if the extension is available *
* Enables Imagick for the QR Code reader if the extension is available.
*/ */
public bool $readerUseImagickIfAvailable = false { public bool $readerUseImagickIfAvailable = false {
set{ set{
@@ -29,19 +30,19 @@ trait QRCodeReaderOptionsTrait{
} }
/** /**
* Grayscale the image before reading * Grayscale the image before reading.
*/ */
public bool $readerGrayscale = false; public bool $readerGrayscale = false;
/** /**
* Invert the colors of the image * Invert the colors of the image.
*/ */
public bool $readerInvertColors = false; public bool $readerInvertColors = false;
/** /**
* Increase the contrast before reading * Increase the contrast before reading.
* *
* note that applying contrast works different in GD and Imagick, so mileage may vary * Note that applying contrast works different in GD and Imagick, so mileage may vary.
*/ */
public bool $readerIncreaseContrast = false; public bool $readerIncreaseContrast = false;