Sunday, October 10, 2010

Installing RMagick on Ubuntu

I installed RMagic.

1. Open Synaptic.
2. Select and install:
rmagic # 2.21-4
librmagic-ruby # libmatic-ruby1.8
librmagic-ruby-doc

(Note: I do not see rmagic for ruby 1.9.1.)

3. Test run.
$ cd images/
$ ls
bardejov.jpg  mincol.jpg  redrock.jpg  rotunda.jpg
$ irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'RMagick'
=> true
irb(main):003:0> include Magick
=> Object
irb(main):004:0> pic = ImageList.new 'redrock.jpg'
=> [redrock.jpg JPEG 150x112 150x112+0+0 DirectClass 8-bit 2kb]
scene=0
irb(main):005:0> pic.display  # this displays the image in a separate window
=> [redrock.jpg JPEG 150x112 150x112+0+0 DirectClass 8-bit 2kb]
scene=0
irb(main):006:0> exit
$ 

4. Here is the displayed image

5. Resources

http://www.imagemagick.org/RMagick/doc/usage.html

No comments:

Post a Comment