From 92a3bb7610d95f39c799d41f432efdc88fe559e5 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Tue, 18 Mar 2025 10:09:32 +0100 Subject: [PATCH] GdThumbGenerator.php: update --- inc/Service/Media/GdThumbGenerator.php | 29 +++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/inc/Service/Media/GdThumbGenerator.php b/inc/Service/Media/GdThumbGenerator.php index 51278a34..1c5f446a 100644 --- a/inc/Service/Media/GdThumbGenerator.php +++ b/inc/Service/Media/GdThumbGenerator.php @@ -103,13 +103,14 @@ class GdThumbGenerator implements ThumbGenerator { if (!link_or_copy($source_file_path, $out_path)) { throw new \RuntimeException("Could not link or copy '$source_file_path' to '$out_path'"); } - $res = new ThumbGenerationResult(); - $res->thumb_file_path = $out_path; - $res->thumb_mime = $source_file_mime; - $res->is_thumb_file_temporary = false; - $res->width = $width; - $res->height = $height; - return $res; + + return new ThumbGenerationResult( + $out_path, + $source_file_mime, + false, + $width, + $height + ); } else { $out_path = $preferred_out_file_path . '.' . self::MIME_TO_EXT[$preferred_out_mime]; @@ -120,13 +121,13 @@ class GdThumbGenerator implements ThumbGenerator { throw new \RuntimeException("Could not create thumbnail file at '$out_path'"); } - $res = new ThumbGenerationResult(); - $res->thumb_file_path = $out_path; - $res->thumb_mime = $preferred_out_mime; - $res->is_thumb_file_temporary = false; - $res->width = $max_width; - $res->height = $max_height; - return $res; + return new ThumbGenerationResult( + $out_path, + $preferred_out_mime, + false, + $max_width, + $max_height + ); } } }