Packages

Mix tasks and library for converting jpeg, png, etc images to webp

Current section

5 Versions

Jump to

Compare versions

4 files changed
+10 additions
-12 deletions
  @@ -23,7 +23,7 @@ then it only needs to be a dev dependency:
23 23 ```elixir
24 24 def deps do
25 25 [
26 - {:webp, "~> 0.1", only: :dev}
26 + {:webp, ">= 0.0.0", only: :dev}
27 27 ]
28 28 end
29 29 ```
  @@ -67,7 +67,7 @@ First add it as a dependency in your `mix.exs`:
67 67 def deps do
68 68 [
69 69 {:phoenix, "~> 1.6.0"},
70 - {:webp, "~> 0.1", runtime: Mix.env() == :dev}
70 + {:webp, ">= 0.0.0", runtime: Mix.env() == :dev}
71 71 ]
72 72 end
73 73 ```
  @@ -26,4 +26,4 @@
26 26 {<<"optional">>,false},
27 27 {<<"repository">>,<<"hexpm">>},
28 28 {<<"requirement">>,<<"~> 1.0">>}]]}.
29 - {<<"version">>,<<"0.1.1">>}.
29 + {<<"version">>,<<"1.0.0">>}.
  @@ -110,23 +110,21 @@ defmodule Webp do
110 110 true ->
111 111 extname = Path.extname(source)
112 112
113 - destination = destination || Path.basename(source, extname)
114 -
115 113 filename = Path.basename(source, extname)
116 114
117 - params = "#{source} -o #{filename}.webp"
115 + destination = config[:destination] || Path.basename(source, extname)
118 116
119 - command = path <> params
117 + params = ["-quiet", "#{source}", "-o", "#{destination}.webp"]
120 118
121 119 path =
122 120 if "--watch" in args do
123 - [script_path() | command]
121 + [script_path() | path]
124 122 else
125 - command
123 + path
126 124 end
127 125
128 126 path
129 - |> cmd(args, opts)
127 + |> cmd(params, opts)
130 128 |> elem(1)
131 129
132 130 false ->
  @@ -177,7 +175,7 @@ defmodule Webp do
177 175
178 176 destination = params[:destination] || Path.basename(source, extname)
179 177
180 - params = ["#{source}", "-o", "#{destination}"]
178 + params = ["-quiet", "#{source}", "-o", "#{destination}.webp"]
181 179
182 180 path
183 181 |> cmd(params, opts)
  @@ -1,7 +1,7 @@
1 1 defmodule ExWebp.MixProject do
2 2 use Mix.Project
3 3
4 - @version "0.1.1"
4 + @version "1.0.0"
5 5 @source_url "https://github.com/mithereal/ex_webp"
6 6
7 7 def project do