aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Photo/PhotoGd.php30
1 files changed, 24 insertions, 6 deletions
diff --git a/Zotlabs/Photo/PhotoGd.php b/Zotlabs/Photo/PhotoGd.php
index 4a47f97ee..a81d9cae2 100644
--- a/Zotlabs/Photo/PhotoGd.php
+++ b/Zotlabs/Photo/PhotoGd.php
@@ -160,16 +160,28 @@ class PhotoGd extends PhotoDriver {
case 'image/png':
$quality = Config::Get('system', 'png_quality');
- if((! $quality) || ($quality > 9))
+
+ if((! $quality) || ($quality > 9)) {
$quality = PNG_QUALITY;
- \imagepng($this->image, NULL, $quality);
+ }
+
+ if (function_exists('imagepng')) {
+ \imagepng($this->image, NULL, $quality);
+ }
+
break;
case 'image/webp':
$quality = Config::Get('system', 'webp_quality');
- if((! $quality) || ($quality > 100))
+
+ if((! $quality) || ($quality > 100)) {
$quality = WEBP_QUALITY;
- \imagewebp($this->image, NULL, $quality);
+ }
+
+ if (function_exists('imagewebp')) {
+ \imagewebp($this->image, NULL, $quality);
+ }
+
break;
case 'image/jpeg':
@@ -177,9 +189,15 @@ class PhotoGd extends PhotoDriver {
default:
$quality = Config::Get('system', 'jpeg_quality');
- if((! $quality) || ($quality > 100))
+
+ if((! $quality) || ($quality > 100)) {
$quality = JPEG_QUALITY;
- \imagejpeg($this->image, NULL, $quality);
+ }
+
+ if (function_exists('imagejpeg')) {
+ \imagejpeg($this->image, NULL, $quality);
+ }
+
break;
}