RMagick + ImageMagick issues on OSX

J

Joe Van Dyk

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. =20


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

Where can I begin troubleshooting?
 
T

Timothy Hunter

Joe said:
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
 
J

Joe Van Dyk

Joe said:
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'
=3D> true
irb(main):002:0> Magick::Image.from_blob(File.read("lodge.jpg"))
=3D> []

Where can I begin troubleshooting?
=20
I get that behavior when I try to read a file that isn't an image. Two
things to try:
=20
1. Can ImageMagick display the image? Try
display lodge.jpg
=20
2. Can you simply read the image? Try this:
img =3D Magick::Image.read('lodge.jpg')
img.display
=20
=20

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

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

Ara.T.Howard

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?

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

(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
--
===============================================================================
| 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
===============================================================================
 
T

Timothy Hunter

Joe said:
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?
 
J

Joe Van Dyk

=20
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...
 
R

rmagick

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top