aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Photo/PhotoGd.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Photo/PhotoGd.php')
-rw-r--r--Zotlabs/Photo/PhotoGd.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/Zotlabs/Photo/PhotoGd.php b/Zotlabs/Photo/PhotoGd.php
index a81d9cae2..8d46ae4d5 100644
--- a/Zotlabs/Photo/PhotoGd.php
+++ b/Zotlabs/Photo/PhotoGd.php
@@ -25,6 +25,8 @@ class PhotoGd extends PhotoDriver {
$t['image/gif'] = 'gif';
if(\imagetypes() & IMG_WEBP)
$t['image/webp'] = 'webp';
+ if(\imagetypes() & IMG_AVIF)
+ $t['image/avif'] = 'avif';
return $t;
}
@@ -184,6 +186,19 @@ class PhotoGd extends PhotoDriver {
break;
+ case 'image/avif':
+ $quality = Config::Get('system', 'avif_quality');
+
+ if((! $quality) || ($quality > 100)) {
+ $quality = AVIF_QUALITY;
+ }
+
+ if (function_exists('imageavif')) {
+ \imageavif($this->image, NULL, $quality);
+ }
+
+ break;
+
case 'image/jpeg':
// gd can lack imagejpeg(), but we verify during installation it is available