move stream_file to its own function

This commit is contained in:
Shish
2020-02-01 21:20:32 +00:00
parent 1b4d06c8d2
commit a5c7faeff7
4 changed files with 41 additions and 33 deletions

View File

@ -47,8 +47,11 @@ class SVGFileHandler extends DataHandlerExtension
{
try {
// 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);
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());