mini_magick gem doesn't work with my ImageMagick install

qendu picture qendu · Apr 1, 2012 · Viewed 9.6k times · Source

I have the ImageMagick installed via MacPorts and the mini_magick gem and I get an error for the following script. How can I resolve this problem?

require 'rubygems'
require 'mini_magick'

image = MiniMagick::Image.open("input.jpg")
image.resize "100x100"
image.write  "output.jpg"



/Users/Max/.rvm/gems/ruby-1.9.3-p125/gems/mini_magick-3.4/lib/mini_magick.rb:164:in `create': MiniMagick::Invalid (MiniMagick::Invalid)
    from /Users/Max/.rvm/gems/ruby-1.9.3-p125/gems/mini_magick-3.4/lib/mini_magick.rb:73:in `read'
    from /Users/Max/.rvm/gems/ruby-1.9.3-p125/gems/mini_magick-3.4/lib/mini_magick.rb:134:in `block in open'
    from /Users/Max/.rvm/gems/ruby-1.9.3-p125/gems/mini_magick-3.4/lib/mini_magick.rb:133:in `open'
    from /Users/Max/.rvm/gems/ruby-1.9.3-p125/gems/mini_magick-3.4/lib/mini_magick.rb:133:in `open'
    from minimagick.rb:4:in `<main>'

Answer

Hugo Demiglio picture Hugo Demiglio · Sep 3, 2012

Try reinstall ImageMagick, if you use Mac OS X:

brew uninstall imagemagick jpeg libtiff jasper
brew install imagemagick

For check if JPG format is now available:

identify -list format | grep JPG

This will return the available formats JPG...