QRGdImageWEBP.php 612 B

1234567891011121314151617181920212223242526272829303132333435
  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;
  14. use function max;
  15. use function min;
  16. /**
  17. * GdImage webp output
  18. *
  19. * @see \imagewebp()
  20. */
  21. class QRGdImageWEBP extends QRGdImage{
  22. final public const MIME_TYPE = 'image/webp';
  23. /**
  24. * @inheritDoc
  25. */
  26. protected function renderImage():void{
  27. imagewebp($this->image, null, max(-1, min(100, $this->options->quality)));
  28. }
  29. }