Giter Club home page Giter Club logo

imgex's Introduction

imgex

An Elixir client library for generating image URLs with imgix

CI Module Version Hex Docs Total Download License Last Updated

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.

imgex's People

Contributors

axelson avatar bgentry avatar ianwalter avatar ivarvong avatar jayjun avatar kianmeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

imgex's Issues

New imgix library ๐Ÿ‘

Hey @ianwalter, this is awesome to see, great work! Tom already did a brief introduction via email, but I wanted to stop by and let you know I'm happy to help answer any questions you have, write some tests, or anything else. Just let me know how I can lend a hand.

If you're interested, we'd also be happy to pull this into the https://github.com/imgix organization, and make it an official library. Of course, you'd retain your admin access if we went this route. Either way is fine by us, but I wanted to make sure you had the option.

Either way, we'd love to get this listed as an available library on https://www.imgix.com/docs/libraries and in https://github.com/imgix/imgix-blueprint. If that's alright with you, I'll go ahead and get it added to those..

Is it possible to use this with Arc.Ecto?

Thanks for the great package!

Is it possible to use this with Arc? I'm struggling to work out how to generate the image urls.

This is how I generate my image urls:

<%= Avatar.Image.url({user.avatar, user}) %>

which gives me a S3 link, but I'm not sure how to use this with Imgex.url.

Updates not Published to Hex

Hi @ianwalter, can you push an update to Hex?

There have been two pull requests since 2015 to fix deprecation warnings, and Iโ€™m afraid the next Elixir release may break this package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.