From deb26ff7d38ebfe41eb35849738ce99d5ba01bac Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 1 Feb 2020 18:51:57 +0000 Subject: [PATCH] faster svg thumbs --- ext/handle_svg/main.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/handle_svg/main.php b/ext/handle_svg/main.php index 2419e3ba..3569d2e8 100644 --- a/ext/handle_svg/main.php +++ b/ext/handle_svg/main.php @@ -46,7 +46,9 @@ class SVGFileHandler extends DataHandlerExtension protected function create_thumb(string $hash, string $type): bool { try { - create_image_thumb($hash, $type, MediaEngine::IMAGICK); + // Normally we require imagemagick, but for unit tests we can use a no-op engine + if(defined('UNITTEST')) create_image_thumb($hash, $type); + else create_image_thumb($hash, $type, MediaEngine::IMAGICK); return true; } catch (MediaException $e) { log_warning("handle_svg", "Could not generate thumbnail. " . $e->getMessage());