Register now and start sharing your code snippets.
-->

Installing ImageMagick, mini-magick and rmagick on Mac OS X Leopard

Ruby posted 7 months ago by christian

I had no success installing ImageMagick and mini-magick with the instructions I found on this page but after some googling I found this blog post, which had the magic commands that worked for me:

   1  sudo port install tiff -macosx  #disables the linkage with Apple's open gl
   2  sudo port install ImageMagick
   3  
   4  sudo gem install rmagick
   5  sudo gem install mini_magick

To test mini-magick, open an irb console and paste in the following code:

   1  require 'rubygems'
   2  require 'mini_magick'
   3  
   4  path = "public/images/0000/0003/logo.jpg"
   5  image = MiniMagick::Image.new(path)
   6  
   7  #print width and height
   8  puts image[:width]
   9  puts image[:height]

Tagged imagemagick, attachment_fu, rails, ruby, mac, osx, leopard, mini-magick, rmagick