From c498f38965786b96eca20e8364fcf751b03e88b2 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Thu, 20 Mar 2025 17:04:27 +0100 Subject: [PATCH] GdMediaHandler.php: add comments --- inc/Service/Media/GdMediaHandler.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/Service/Media/GdMediaHandler.php b/inc/Service/Media/GdMediaHandler.php index def6f204..1ac74e16 100644 --- a/inc/Service/Media/GdMediaHandler.php +++ b/inc/Service/Media/GdMediaHandler.php @@ -5,6 +5,9 @@ use Vichan\Data\ThumbGenerationResult; use Vichan\Functions\Fs; +/** + * Basically a fallback implementation. GD does not handle color profiles outside of webp. + */ class GdMediaHandler implements MediaHandler { private const PHP81 = \PHP_MAJOR_VERSION >= 8 && \PHP_MINOR_VERSION >= 1; @@ -41,6 +44,7 @@ class GdMediaHandler implements MediaHandler { public static function imageSaveTo(mixed $gd, string $file, string $mime) { // Somebody should tune the quality and speed values... + // Won't be me. switch ($mime) { case 'image/jpeg': return \imagejpeg($gd, $file, 50); @@ -132,6 +136,7 @@ class GdMediaHandler implements MediaHandler { /** * @param bool $strip_redraw If the EXIF metadata should be stripped by redrawing it. + * May cause the loss of color profiles. Orientation is still handled. */ public function __construct(bool $strip_redraw) { $this->strip_redraw = $strip_redraw;