mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +01:00
modules/media/thumbnail: Get magick availability this way for now.
This commit is contained in:
parent
06e7d94aef
commit
8a69adb9c5
1 changed files with 15 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue