From 89dd1a765873a28f257ffec7bae62e1f4130fb1e Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 23 Feb 2020 22:12:18 +0000 Subject: [PATCH] create_scaled_image, for other uses --- core/imageboard/misc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/imageboard/misc.php b/core/imageboard/misc.php index ed2fe5f8..393e0f94 100644 --- a/core/imageboard/misc.php +++ b/core/imageboard/misc.php @@ -128,12 +128,15 @@ function get_thumbnail_max_size_scaled(): array function create_image_thumb(string $hash, string $type, string $engine = null) { - global $config; - - $inname = warehouse_path(Image::IMAGE_DIR, $hash); + $inname = warehouse_path(Image::IMAGE_DIR, $hash); $outname = warehouse_path(Image::THUMBNAIL_DIR, $hash); $tsize = get_thumbnail_max_size_scaled(); + create_scaled_image($inname, $outname, $tsize, $type, $engine); +} +function create_scaled_image(string $inname, string $outname, array $tsize, string $type, ?string $engine) +{ + global $config; if (empty($engine)) { $engine = $config->get_string(ImageConfig::THUMB_ENGINE); }