QRGdImageWEBP.php 586 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Class QRGdImageWEBP
  4. *
  5. * @created 25.10.2023
  6. * @author smiley <smiley@chillerlan.net>
  7. * @copyright 2023 smiley
  8. * @license MIT
  9. *
  10. * @noinspection PhpComposerExtensionStubsInspection
  11. */
  12. namespace chillerlan\QRCode\Output;
  13. use function imagewebp, max, min;
  14. /**
  15. * GdImage webp output
  16. *
  17. * @see \imagewebp()
  18. */
  19. class QRGdImageWEBP extends QRGdImage{
  20. final public const MIME_TYPE = 'image/webp';
  21. /**
  22. * @inheritDoc
  23. */
  24. protected function renderImage():void{
  25. imagewebp($this->image, null, max(-1, min(100, $this->options->quality)));
  26. }
  27. }