From 8a69adb9c5a85b372e88487741a8d6e9077ac9f4 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 4 Jun 2019 02:22:09 -0700 Subject: [PATCH] modules/media/thumbnail: Get magick availability this way for now. --- modules/media/thumbnail.cc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/media/thumbnail.cc b/modules/media/thumbnail.cc index 95dc63739..75b2ee638 100644 --- a/modules/media/thumbnail.cc +++ b/modules/media/thumbnail.cc @@ -236,13 +236,24 @@ get__thumbnail_local(client &client, copied }; + static const bool available + { + mods::loaded("media_magick") + }; + const bool fallback // Reasons to just send the original image { + // Disabled by configuration !enable || - !dimension.first || - !dimension.second || - (method != "scale" && method != "crop") - //TODO: condition if magick is actually loaded + + // Unknown thumbnailing method in query string + (method != "scale" && method != "crop") || + + // No dimension parameters given in query string + (!dimension.first || !dimension.second) || + + // The thumbnailer is not loaded or available on this system. + !available }; if(fallback)