Add GIF support

This commit is contained in:
Evgeniy Khramtsov 2017-09-17 17:34:31 +03:00
parent e4d21c1941
commit f435d0a103
2 changed files with 15 additions and 4 deletions

View File

@ -44,7 +44,7 @@
{tag, "1.0.2"}}}}, {tag, "1.0.2"}}}},
{if_var_true, riak, {riakc, ".*", {git, "https://github.com/processone/riak-erlang-client.git", {if_var_true, riak, {riakc, ".*", {git, "https://github.com/processone/riak-erlang-client.git",
{tag, "2.5.3"}}}}, {tag, "2.5.3"}}}},
{if_var_true, graphics, {eimp, ".*", {git, "https://github.com/processone/eimp.git"}}}, {if_var_true, graphics, {eimp, ".*", {git, "https://github.com/processone/eimp.git", "dc5bfe0"}}},
%% Elixir support, needed to run tests %% Elixir support, needed to run tests
{if_var_true, elixir, {elixir, ".*", {git, "https://github.com/elixir-lang/elixir", {if_var_true, elixir, {elixir, ".*", {git, "https://github.com/elixir-lang/elixir",
{tag, {if_version_above, "17", "v1.4.4", "v1.1.1"}}}}}, {tag, {if_version_above, "17", "v1.4.4", "v1.1.1"}}}}},

View File

@ -399,6 +399,7 @@ decode_mime_type(MimeType) ->
<<"image/jpeg">> -> jpeg; <<"image/jpeg">> -> jpeg;
<<"image/png">> -> png; <<"image/png">> -> png;
<<"image/webp">> -> webp; <<"image/webp">> -> webp;
<<"image/gif">> -> gif;
_ -> unknown _ -> unknown
end. end.
@ -414,23 +415,33 @@ have_eimp() -> false.
mod_opt_type({convert, png}) -> mod_opt_type({convert, png}) ->
fun(jpeg) -> jpeg; fun(jpeg) -> jpeg;
(webp) -> webp (webp) -> webp;
(gif) -> gif
end; end;
mod_opt_type({convert, webp}) -> mod_opt_type({convert, webp}) ->
fun(jpeg) -> jpeg; fun(jpeg) -> jpeg;
(png) -> png (png) -> png;
(gif) -> gif
end; end;
mod_opt_type({convert, jpeg}) -> mod_opt_type({convert, jpeg}) ->
fun(png) -> png; fun(png) -> png;
(webp) -> webp;
(gif) -> gif
end;
mod_opt_type({convert, gif}) ->
fun(png) -> png;
(jpeg) -> jpeg;
(webp) -> webp (webp) -> webp
end; end;
mod_opt_type({convert, default}) -> mod_opt_type({convert, default}) ->
fun(png) -> png; fun(png) -> png;
(webp) -> webp; (webp) -> webp;
(jpeg) -> jpeg (jpeg) -> jpeg;
(gif) -> gif
end; end;
mod_opt_type(_) -> mod_opt_type(_) ->
[{convert, default}, [{convert, default},
{convert, webp}, {convert, webp},
{convert, png}, {convert, png},
{convert, gif},
{convert, jpeg}]. {convert, jpeg}].