Created
October 10, 2016 12:39
-
-
Save radzserg/658c28ce65269cdeddfe698d95a1c6cf to your computer and use it in GitHub Desktop.
elixir image helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule App.Helpers.ImageHelper do | |
| #https://github.com/route/mogrify | |
| import Mogrify | |
| def thumb(src, dest, width, height) do | |
| open(src) | |
| |> resize_to_fill("#{width}x#{height}") | |
| |> gravity("center") | |
| |> save(path: dest) | |
| :ok | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment