Libraries
imgix-elixir build
Installation
imgex is available in Hex, the package can be installed as:
Add :imgex
to your list of dependencies in mix.exs
:
def deps do
[
{:imgex, "~> 0.2.0"},
]
end
Documentation
The source is really small so reading through it should be straight-forward but the full package documentation is available at https://hexdocs.pm/imgex.
Configuration
To use the library you have to configure your imgix domain and secure token or pass them as an options map %{domain: "domain", token: "token"}
as the third parameter to Imgex.url/3
or Imgex.proxy_url/3
. See config/test.exs
for an example of how to configure this.
Usage
To generate an imgix URL based on a path (Web Folder and S3 sources) and optional parameters do:
url = Imgex.url "/images/cats.jpg", %{w: 700}
To generate an imgix URL based on a public URL (Web Proxy sources) and optional parameters do:
url = Imgex.proxy_url "https://some-public-url.com/cats.jpg", %{w: 700}
Copyright and License
Copyright (c) 2019 Ian Walter
This work is free. You can redistribute it and/or modify it under the terms of the ISC License. See the LICENSE.md file for more details.
More Core Libraries
- imgix-csharpbuildA C# client library for generating image URLs with imgixC# 13 3 months ago
- imgix-gobuildA Go client library for generating image URLs with imgixGo 11 4 months ago
- imgix-javabuildA Java client library for generating URLs with imgixJava 17 5 months ago
- imgix-phpbuildA PHP client library for generating URLs with imgixPHP 108 2 months ago
- imgix-pythonbuildA Python client library for generating URLs with imgixPython 37 3 months ago
- imgix-rbbuildA Ruby gem for generating image URLs with imgixRuby 76 3 months ago
- imgix-swiftbuildA Swift client library for generating URLs with imgixSwift 24 5 months ago
- @imgix/js-corebuildA JavaScript client library for generating image URLs with imgixJavaScript 117 7 days ago