Debian Codegraph @

vendor/chillerlan/php-qrcode/src/Output/QRGdImageBMP.php

raw
1 <?php
2 /**
3 * Class QRGdImageBMP
4 *
5 * @created 25.10.2023
6 * @author smiley <[email protected]>
7 * @copyright 2023 smiley
8 * @license MIT
9 *
10 * @noinspection PhpComposerExtensionStubsInspection
11 */
12 declare(strict_types=1);
13
14 namespace chillerlan\QRCode\Output;
15
16 use function imagebmp;
17
18 /**
19 * GdImage bmp output
20 *
21 * @see \imagebmp()
22 */
23 class QRGdImageBMP extends QRGdImage{
24
25 final public const MIME_TYPE = 'image/bmp';
26
27 /**
28 * @throws \chillerlan\QRCode\Output\QRCodeOutputException
29 */
30 protected function renderImage():void{
31 // the $compressed parameter is boolean here
32 if(imagebmp(image: $this->image, compressed: ($this->options->quality > 0)) === false){
33 throw new QRCodeOutputException('imagebmp() error');
34 }
35 }
36
37 }