mod_http_upload: Check availability of ImageMagick

Log an error message during startup if the thumbnail option is enabled
but ImageMagick is not installed.
This commit is contained in:
Holger Weiss 2015-11-02 01:12:10 +01:00
parent eeb705fc2f
commit 9d2f1d5f0d
1 changed files with 12 additions and 0 deletions

View File

@ -272,6 +272,18 @@ init({ServerHost, Opts}) ->
Mode ->
file:change_mode(DocRoot, Mode)
end,
case Thumbnail of
true ->
case string:str(os:cmd("identify"), "Magick") of
0 ->
?ERROR_MSG("Cannot find 'identify' command, please install "
"ImageMagick or disable thumbnail creation", []);
_ ->
ok
end;
false ->
ok
end,
ejabberd_router:register_route(Host),
{ok, #state{server_host = ServerHost, host = Host, name = Name,
access = Access, max_size = MaxSize,