| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Class QRGdImageJPEG |
| 5 |
* |
| 6 |
* @created 25.10.2023 |
| 7 |
* @author smiley <[email protected]> |
| 8 |
* @copyright 2023 smiley |
| 9 |
* @license MIT |
| 10 |
* |
| 11 |
* @noinspection PhpComposerExtensionStubsInspection |
| 12 |
*/ |
| 13 |
namespace WCPOS\Vendor\chillerlan\QRCode\Output; |
| 14 |
|
| 15 |
use function imagejpeg, max, min; |
| 16 |
/** |
| 17 |
* GdImage jpeg output |
| 18 |
* |
| 19 |
* @see \imagejpeg() |
| 20 |
*/ |
| 21 |
class QRGdImageJPEG extends QRGdImage |
| 22 |
{ |
| 23 |
public const MIME_TYPE = 'image/jpg'; |
| 24 |
/** |
| 25 |
* @inheritDoc |
| 26 |
*/ |
| 27 |
protected function setTransparencyColor() : void |
| 28 |
{ |
| 29 |
// noop - transparency is not supported |
| 30 |
} |
| 31 |
/** |
| 32 |
* @inheritDoc |
| 33 |
*/ |
| 34 |
protected function renderImage() : void |
| 35 |
{ |
| 36 |
imagejpeg($this->image, null, max(-1, min(100, $this->options->quality))); |
| 37 |
} |
| 38 |
} |
| 39 |
|