faster svg thumbs

This commit is contained in:
Shish 2020-02-01 18:51:57 +00:00
parent 89ca23a4fd
commit deb26ff7d3

View file

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