0.0
No commit activity in last 3 years
No release in over 3 years
This is not a simple 'Ruby'-like implementation. It is more of a raw 'C' implementation. As such, it may be a bit more difficult to work with than something like rmagick, but it should perform just as well.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 0

Runtime

~> 1.9
 Project Readme

FFI::GMagick

FFI wrapper for the GraphicsMagick image processing library.

NOTE: This library probably has memory leaks that you might need to be aware of. You have been warned!

Project Status Code Climate

Introduction

This Gem provides an FFI wrapper for the GraphicsMagick image processing library. All of the other *Magick Gems I found either only worked with ImageMagick or were simply wrappers around the command line interfaces. These are great Gems but I needed to work with images in RAM and not hit the hard drive at all. So, I created this Gem to allow me to work with images completely in RAM without touching the file system at all.

Installation

Add this line to your application's Gemfile:

gem 'ffi-gmagick'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ffi-gmagick

You also must have a recent version of GraphicsMagick installed and the library in your systems load path. Don't worry about the load path, most installers do that for you.

Usage

Basic usage is as following:

require 'ffi/gmagick'

WATERMARK = FFI::GMagick::Image.new
WATERMARK.from_blob(File.open("watermark.png").read)

image = FFI::GMagick::Image.new
image.from_blob(File.open("./my_picture.jpg").read)

new_thumbnail = image.thumbnail(100, 100, true)
new_thumbnail.compose(WATERMARK)

new_thumbnail.to_file("./my_thumb.jpg")

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request