RMagick + ImageMagick issues on OSX

Hi,

I compiled and installed ImageMagick from scratch. Seemed to install
fine. Also installed RMagick via gems. (all last night)

Magick::Image.from_blob ain't working though.

irb(main):001:0> require 'RMagick'
=> true
irb(main):002:0> Magick::Image.from_blob(File.read("lodge.jpg"))
=> []

Where can I begin troubleshooting?

Joe Van Dyk wrote:

Hi,

I compiled and installed ImageMagick from scratch. Seemed to install
fine. Also installed RMagick via gems. (all last night)

Magick::Image.from_blob ain't working though.

irb(main):001:0> require 'RMagick'
=> true
irb(main):002:0> Magick::Image.from_blob(File.read("lodge.jpg"))
=>

Where can I begin troubleshooting?

I get that behavior when I try to read a file that isn't an image. Two things to try:

1. Can ImageMagick display the image? Try
  display lodge.jpg

2. Can you simply read the image? Try this:
  img = Magick::Image.read('lodge.jpg')
  img.display

irb(main):002:0> img = Magick::Image.read('lodge.jpg')
Magick::ImageMagickError: no decode delegate for this image format `lodge.jpg':
        from (irb):2:in `read'
        from (irb):2

I assume that means that imagemagick wasn't compiled with enough image
support, right?

···

On 9/14/05, Timothy Hunter <cyclists@nc.rr.com> wrote:

Joe Van Dyk wrote:
> Hi,
>
> I compiled and installed ImageMagick from scratch. Seemed to install
> fine. Also installed RMagick via gems. (all last night)
>
> Magick::Image.from_blob ain't working though.
>
>
> irb(main):001:0> require 'RMagick'
> => true
> irb(main):002:0> Magick::Image.from_blob(File.read("lodge.jpg"))
> =>
>
> Where can I begin troubleshooting?
>
>

I get that behavior when I try to read a file that isn't an image. Two
things to try:

1. Can ImageMagick display the image? Try
        display lodge.jpg

2. Can you simply read the image? Try this:
        img = Magick::Image.read('lodge.jpg')
        img.display

don't suppose you want to hear that i spent all day compiling it for redhat
enterprise boxes do you? :wink:

(those of you using rpms out there should know they are badly broken).

there are only about 3700 image delegates to track down and compile - on the
bright side they all google right up and compile easily.

good luck.

-a

···

On Thu, 15 Sep 2005, Joe Van Dyk wrote:

irb(main):002:0> img = Magick::Image.read('lodge.jpg')
Magick::ImageMagickError: no decode delegate for this image format `lodge.jpg':
       from (irb):2:in `read'
       from (irb):2

I assume that means that imagemagick wasn't compiled with enough image
support, right?

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna

===============================================================================

Joe Van Dyk wrote:

irb(main):002:0> img = Magick::Image.read('lodge.jpg')
Magick::ImageMagickError: no decode delegate for this image format `lodge.jpg': from (irb):2:in `read'
        from (irb):2

I assume that means that imagemagick wasn't compiled with enough image
support, right?

In the README-OSX.txt file that comes with RMagick I outline a process for installing RMagick that gets the ImageMagick delegate libraries via Darwinports. It also shows how to determine if ImageMagick is configured the way you need it. Why don't you give that process a try and let me know how it turns out?

Actually, all I needed to do was:

sudo port install ghostscript
sudo port install imagemagick
sudo gem install rmagick

and it seems to work fine.

I'm getting some font errors when building the examples.
RMagick: unable to read font `helvetica'.
RMagick: unable to read font `Verdana'.

But I don't think I have any Microsoft fonts installed...

···

On 9/15/05, Timothy Hunter <cyclists@nc.rr.com> wrote:

Joe Van Dyk wrote:
> irb(main):002:0> img = Magick::Image.read('lodge.jpg')
> Magick::ImageMagickError: no decode delegate for this image format `lodge.jpg':
> from (irb):2:in `read'
> from (irb):2
>
> I assume that means that imagemagick wasn't compiled with enough image
> support, right?

In the README-OSX.txt file that comes with RMagick I outline a process
for installing RMagick that gets the ImageMagick delegate libraries via
Darwinports. It also shows how to determine if ImageMagick is configured
the way you need it. Why don't you give that process a try and let me
know how it turns out?

ImageMagick doesn't look up fonts dynamically. It has a couple of fixed
sets it knows how to use. At config time you (or whoever is configuring
it) tell IM which set(s) of fonts to use and where to find them.
Whoever made the port did the configuring, so that version of
ImageMagick is configured for them, not for you. This is one of the
reasons I recommend installing from source. The short-cuts always seem
to take longer...

Now that you've got all the dependent libraries installed it should be
fairly easy to uninstall ImageMagick and re-install from source. It
takes about 5-10 minutes on my Powerbook. Or I can try to coach you
through manually editing the font config files. If you decide to go
with the first option check out RMagick's README file, 'cause it's got
lots of advice on how to configure ImageMagick.