aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/chillerlan/php-qrcode/src/Output/QRGdImageWEBP.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/chillerlan/php-qrcode/src/Output/QRGdImageWEBP.php')
-rw-r--r--vendor/chillerlan/php-qrcode/src/Output/QRGdImageWEBP.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/vendor/chillerlan/php-qrcode/src/Output/QRGdImageWEBP.php b/vendor/chillerlan/php-qrcode/src/Output/QRGdImageWEBP.php
new file mode 100644
index 000000000..cf8dfa9a5
--- /dev/null
+++ b/vendor/chillerlan/php-qrcode/src/Output/QRGdImageWEBP.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Class QRGdImageWEBP
+ *
+ * @created 25.10.2023
+ * @author smiley <smiley@chillerlan.net>
+ * @copyright 2023 smiley
+ * @license MIT
+ *
+ * @noinspection PhpComposerExtensionStubsInspection
+ */
+
+namespace chillerlan\QRCode\Output;
+
+use function imagewebp, max, min;
+
+/**
+ * GdImage webp output
+ *
+ * @see \imagewebp()
+ */
+class QRGdImageWEBP extends QRGdImage{
+
+ public const MIME_TYPE = 'image/webp';
+
+ /**
+ * @inheritDoc
+ */
+ protected function renderImage():void{
+ imagewebp($this->image, null, max(-1, min(100, $this->options->quality)));
+ }
+
+}