25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

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

View File

@ -272,6 +272,18 @@ init({ServerHost, Opts}) ->
Mode -> Mode ->
file:change_mode(DocRoot, Mode) file:change_mode(DocRoot, Mode)
end, 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), ejabberd_router:register_route(Host),
{ok, #state{server_host = ServerHost, host = Host, name = Name, {ok, #state{server_host = ServerHost, host = Host, name = Name,
access = Access, max_size = MaxSize, access = Access, max_size = MaxSize,