Imgex
An Elixir client library for generating image URLs with imgix
Install / Use
/learn @ianwalter/ImgexREADME
imgex
<!-- /ix-docs-ignore -->An Elixir client library for generating image URLs with imgix
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.
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
