GdThumbGenerator.php: update

This commit is contained in:
Zankaria 2025-03-18 10:09:32 +01:00
parent b4c2c7ab56
commit 92a3bb7610

View file

@ -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
);
}
}
}