|
15 | 15 |
|
16 | 16 | /** |
17 | 17 | * Trait QRCodeReaderOptionsTrait |
18 | | - * |
19 | | - * @property bool $readerUseImagickIfAvailable |
20 | | - * @property bool $readerGrayscale |
21 | | - * @property bool $readerInvertColors |
22 | | - * @property bool $readerIncreaseContrast |
23 | 18 | */ |
24 | 19 | trait QRCodeReaderOptionsTrait{ |
25 | 20 |
|
26 | 21 | /** |
27 | | - * Use Imagick (if available) when reading QR Codes |
| 22 | + * Use Imagick (if available) when reading QR Codes, |
| 23 | + * enables Imagick for the QR Code reader if the extension is available |
28 | 24 | */ |
29 | | - protected bool $readerUseImagickIfAvailable = false; |
| 25 | + public bool $readerUseImagickIfAvailable = false { |
| 26 | + set{ |
| 27 | + $this->readerUseImagickIfAvailable = ($value && extension_loaded('imagick')); |
| 28 | + } |
| 29 | + } |
30 | 30 |
|
31 | 31 | /** |
32 | 32 | * Grayscale the image before reading |
33 | 33 | */ |
34 | | - protected bool $readerGrayscale = false; |
| 34 | + public bool $readerGrayscale = false; |
35 | 35 |
|
36 | 36 | /** |
37 | 37 | * Invert the colors of the image |
38 | 38 | */ |
39 | | - protected bool $readerInvertColors = false; |
| 39 | + public bool $readerInvertColors = false; |
40 | 40 |
|
41 | 41 | /** |
42 | 42 | * Increase the contrast before reading |
43 | 43 | * |
44 | 44 | * note that applying contrast works different in GD and Imagick, so mileage may vary |
45 | 45 | */ |
46 | | - protected bool $readerIncreaseContrast = false; |
47 | | - |
48 | | - /** |
49 | | - * enables Imagick for the QR Code reader if the extension is available |
50 | | - */ |
51 | | - protected function set_readerUseImagickIfAvailable(bool $useImagickIfAvailable):void{ |
52 | | - $this->readerUseImagickIfAvailable = ($useImagickIfAvailable && extension_loaded('imagick')); |
53 | | - } |
| 46 | + public bool $readerIncreaseContrast = false; |
54 | 47 |
|
55 | 48 | } |
0 commit comments