create_scaled_image, for other uses

This commit is contained in:
Shish 2020-02-23 22:12:18 +00:00
parent 85731ebf65
commit 89dd1a7658

View file

@ -128,12 +128,15 @@ function get_thumbnail_max_size_scaled(): array
function create_image_thumb(string $hash, string $type, string $engine = null) 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); $outname = warehouse_path(Image::THUMBNAIL_DIR, $hash);
$tsize = get_thumbnail_max_size_scaled(); $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)) { if (empty($engine)) {
$engine = $config->get_string(ImageConfig::THUMB_ENGINE); $engine = $config->get_string(ImageConfig::THUMB_ENGINE);
} }