View Source Webp (webp v1.1.1)

Webp is a installer and runner for [Webp].

profiles

Profiles

You can define multiple configuration profiles. By default, there is a profile called :default which you can configure its args, current directory and environment:

config :webp,
  default: [
    location: Path.expand("../priv/static/images/", __DIR__),
    destination: Path.expand("../priv/static/images/", __DIR__)
  ]

webp-configuration

Webp configuration

There are two global configurations for the webp application:

  • :path - the path to the webp executable.

Once you find the location of the executable, you can store it in a MIX_WEBP_PATH environment variable, which you can then read in your configuration file:

config :webp, path: System.get_env("MIX_WEBP_PATH")

Link to this section Summary

Functions

Returns the path to the executable.

Returns the configuration for the given profile.

Convert Source to Destination args.

Convert Source to Destination if cwebp exists.

Runs the given command with args.

Link to this section Functions

Returns the path to the executable.

The executable may not be available if it was not yet installed.

Returns the configuration for the given profile.

Returns nil if the profile does not exist.

Link to this function

convert(source, params \\ [])

View Source

Convert Source to Destination args.

Link to this function

install_and_run(profile, args)

View Source

Convert Source to Destination if cwebp exists.

Link to this function

run(profile, extra_args)

View Source

Runs the given command with args.

The given args will be appended to the configured args. The task output will be streamed directly to stdio. It returns the status of the underlying call.