artifact alternatives and similar packages
Based on the "Images" category.
Alternatively, view artifact alternatives based on common mentions on social networks and blogs.
-
cloudex
An elixir library which helps with uploading image files or urls to cloudinary -
ex_image_info
ExImageInfo is an Elixir library to parse images (binaries) and get the dimensions (size), detected mime-type and overall validity for a set of image formats. It is the fastest and supports multiple formats. -
exexif
Pure elixir library to extract tiff and exif metadata from jpeg files -
png
A pure Erlang library for creating PNG images. It can currently create 8 and 16 bit RGB, RGB with alpha, indexed, grayscale and grayscale with alpha images. -
thumbnex
Elixir library to create thumbnails from images and video screenshots. -
eikon
Eikōn is an Elixir library providing a read-only interface for image files. -
gi
Gi is a library for manipulating Graphics Interfacing. Use utility mogrify, identify, ... of GraphicsMagick to resize, draw on base images....
Static code analysis for 29 languages.
Do you think we are missing an alternative of artifact or a related project?
Popular Comparisons
README
Artifact
File upload and on-the-fly processing for Elixir
Artifact is under active development, join the fun!
Installation
Add artifact
to your list of dependencies in mix.exs
:
def deps do
[{:artifact, "~> 0.4"}]
end
Next, add :artifact to your list of applications:
def application do
[applications: [:artifact]]
end
Since artifact
relies on external processes for transformations, it is recommended that you install the goon middleware. To install, download the package for your system and unzip the contents somewhere in your $PATH:
$ sudo tar zxf goon_darwin_amd64.tar.gz -C /usr/local/bin/
By default artifact
uses the imagemagick software which is available via your os package manager, homebrew or from http://www.imagemagick.org/.
Setup in 1-2-3
Define a module and
use
Artifact:defmodule ExampleUploader do use Artifact, otp_app: :my_app end
Add the supervisor to your supervisor tree:
def start(_type, _args) do import Supervisor.Spec, warn: false children = [ supervisor(ExampleUploader.Supervisor, []) ] opts = [strategy: :one_for_one, name: MyApp.Supervisor] Supervisor.start_link(children, opts) end
Update your router to include the generated plug:
forward "/images", ExampleUploader.Endpoint
Configuration
config :my_app, ExampleUploader,
asset_host: "http://www.example.com/images",
asset_url: "/:format/:name",
default: "placeholder.png",
formats: %{
thumb: "convert -'[0]' -resize 50x50 -gravity center +repage -strip jpg:-"
}
config :my_app, ExampleUploader.Storage,
type: Artifact.Storage.Local,
storage_dir: Path.expand("../web/static/assets/images", __DIR__)
config :my_app, ExampleUploader.Pool,
pool_size: 1
Use
iex> {:ok, name} = ExampleUploader.put(data, name: "profile.png")
iex> name
"profile.png"
iex> {:ok, url} = ExampleUploader.URLHelpers.url(name, :thumb)
"http://www.example.com/images/thumb/profile.png"
Phoenix Integration
Using Aritfact with Phoenix? It may be helpful to update your web/web.ex
to alias or import the uploader's url helpers:
def view do
quote do
use Phoenix.View, root: "web/templates"
import Phoenix.Controller, only: [get_csrf_token: 0, get_flash: 2, view_module: 1]
use Phoenix.HTML
# We'll use an alias with a shorter name
alias ExampleUploader.URLHelpers, as: Images
import BevReviews.Router.Helpers
import BevReviews.ErrorHelpers
import BevReviews.Gettext
end
end
Now we can generate URLs in our markup:
<img class="img-responsive img-thumb" src="<%= Images.url(user.avatar, :thumb) %>" alt="">
The value of user.avatar
can be both a filename or a subpath from web/static/assets/images/
.
License
Artifact source code is released under Apache 2.0 License.
See [LICENSE](LICENSE) for more information.
*Note that all licence references and agreements mentioned in the artifact README section above
are relevant to that project's source code only.