项目作者: nuex

项目描述 :
An Erlang GraphicsMagick wrapper
高级语言: Erlang
项目地址: git://github.com/nuex/erl_gm.git
创建时间: 2011-09-30T23:16:19Z
项目社区:https://github.com/nuex/erl_gm

开源协议:MIT License

下载


erl_gm

An Erlang GraphicsMagick wrapper

USAGE

  1. % Crop image into 100x100 tiles
  2. gm:convert("/some/image.jpg", "tile", [{crop, 100, 100}]).
  3. % Get multiple identify properties (returns a list of key value pairs
  4. % to be parsed by proplist:get_value
  5. gm:identify_explicit("/some/image.jpg", [width, height, filename, type]).
  6. % Crazytown
  7. gm:convert("/some/image.jpg", "/something/crazy.jpg", [
  8. flip,
  9. magnify,
  10. {rotate, 45},
  11. {blur, 7, 3},
  12. {crop, 300, 300, 150, 130},
  13. {edge, 3}
  14. ]).
  15. % Resize
  16. gm:convert("/some/image.jpg", "/something/resized.jpg", [{resize, 240, 240}]).

ELIXIR INSTALLATION

Add erl_gm to your mix.exs dependencies:

  1. def deps do
  2. [{:gm, git: "https://github.com/nuex/erl_gm"}]
  3. end

List the :gm application as your application dependency (from Elixir version 1.4.0 may not be necessary)

  1. def application do
  2. [applications: [:gm]]
  3. end

ELIXIR USAGE

  1. iex> :gm.convert('/some/image.jpg', '/some/cropped.jpg', [{:crop, 100, 100}])

AVAILABLE GM FUNCTIONS

  1. gm:composite
  2. gm:convert
  3. gm:identify
  4. gm:mogrify
  5. gm:montage
  6. gm:version

AVAILABLE GM OPTIONS

  1. -adjoin
  2. -background
  3. -blur
  4. -create_directories
  5. -crop
  6. -define
  7. -dissolve
  8. -draw
  9. -edge
  10. -extent
  11. -flatten
  12. -fill
  13. -flip
  14. -format
  15. -geometry
  16. -gravity
  17. -interlace
  18. -magnify
  19. +matte
  20. -matte
  21. -negate
  22. -opaque
  23. -output_directory
  24. -quality
  25. -resize
  26. -rotate
  27. -size
  28. -transparent
  29. -thumbnail
  30. -type
  31. -watermark

AVAILABLE SHORTCUTS

  1. gm:identify_explicit

EXTENDING

New options can be added to gm_options.erl to broaden option support. Just open a pull request and I’ll merge in additions.

LICENSE

MIT