mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +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:
parent
eeb705fc2f
commit
9d2f1d5f0d
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user