RMagick on MacOS X (can't read a JPG)

G

Gavin Kistner

I am trying to automate a bunch of thumbnail creations, and thought
I'd use RMagick/ImageMagick.

I built ImageMagick from source, and used the gem to install RMagick,
but when I write a simple program, I see this:

[Sliver:~/Desktop/NO] gkistner$ cat makesmall.rb
require 'RMagick'
orig = Magick::ImageList.new("IMG_4340.jpg")
puts orig.columns, orig.rows

[Sliver:~/Desktop/NO] gkistner$ ruby makesmall.rb
/usr/local/lib/ruby/site_ruby/1.8/RMagick.rb:1378:in `read': no
decode delegate for this image format `IMG_4340.jpg':
(Magick::ImageMagickError)
from /usr/local/lib/ruby/site_ruby/1.8/RMagick.rb:1378:in
`initialize'
from /usr/local/lib/ruby/site_ruby/1.8/RMagick.rb:1377:in
`each'
from /usr/local/lib/ruby/site_ruby/1.8/RMagick.rb:1377:in
`initialize'
from makesmall.rb:4:in `new'
from makesmall.rb:4

[Sliver:~/Desktop/NO] gkistner$ convert -version
Version: ImageMagick 6.2.2 05/17/05 Q16 file:/usr/share/
ImageMagick-6.2.2/doc/index.html
Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC

[Sliver:~/Desktop/NO] gkistner$ convert -list format | grep JPEG
see part 5 which describes the image encoding (RLE, JPEG,
JPEG-LS),
and supplement 61 which adds JPEG-2000 encoding.


When I built ImageMagick, I followed the advice on this page[1] and
set all the environment variables first (and also tried specifying
options to configure like --with-jpeg) but I'm still seeing this
error. (I also first tried it without any special options.)


Anyone know what's up? Anyone got RMagick working on MacOS X (Tiger)?


[1] http://grotto11.com/blog/archive/1060372029.shtml
 
D

Doug Beaver

I am trying to automate a bunch of thumbnail creations, and thought
I'd use RMagick/ImageMagick.

I built ImageMagick from source, and used the gem to install RMagick,
but when I write a simple program, I see this:

[Sliver:~/Desktop/NO] gkistner$ cat makesmall.rb
require 'RMagick'
orig = Magick::ImageList.new("IMG_4340.jpg")
puts orig.columns, orig.rows

[Sliver:~/Desktop/NO] gkistner$ ruby makesmall.rb
/usr/local/lib/ruby/site_ruby/1.8/RMagick.rb:1378:in `read': no
decode delegate for this image format `IMG_4340.jpg':
(Magick::ImageMagickError)

the last time i built graphicsmagick for os x, i had to build my own
copy of libjpeg and link it in to GM so that the RMagick build could
find the library. you should try that...

doug
 
G

Gavin Kistner

--Apple-Mail-1-674781870
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed

the last time i built graphicsmagick for os x, i had to build my own
copy of libjpeg and link it in to GM so that the RMagick build could
find the library. you should try that...

Could you elaborate on what "link it in to GM" means?

--Apple-Mail-1-674781870--
 
R

rmagick

Gavin said:
I am trying to automate a bunch of thumbnail creations, and thought
I'd use RMagick/ImageMagick.

I built ImageMagick from source, and used the gem to install RMagick,
but when I write a simple program, I see this:

[Sliver:~/Desktop/NO] gkistner$ cat makesmall.rb
require 'RMagick'
orig = Magick::ImageList.new("IMG_4340.jpg")
puts orig.columns, orig.rows

[Sliver:~/Desktop/NO] gkistner$ ruby makesmall.rb
/usr/local/lib/ruby/site_ruby/1.8/RMagick.rb:1378:in `read': no
decode delegate for this image format `IMG_4340.jpg':
(Magick::ImageMagickError)
from /usr/local/lib/ruby/site_ruby/1.8/RMagick.rb:1378:in
`initialize'
from /usr/local/lib/ruby/site_ruby/1.8/RMagick.rb:1377:in
`each'
from /usr/local/lib/ruby/site_ruby/1.8/RMagick.rb:1377:in
`initialize'
from makesmall.rb:4:in `new'
from makesmall.rb:4

[Sliver:~/Desktop/NO] gkistner$ convert -version
Version: ImageMagick 6.2.2 05/17/05 Q16 file:/usr/share/
ImageMagick-6.2.2/doc/index.html
Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC

[Sliver:~/Desktop/NO] gkistner$ convert -list format | grep JPEG
see part 5 which describes the image encoding (RLE, JPEG,
JPEG-LS),
and supplement 61 which adds JPEG-2000 encoding.


When I built ImageMagick, I followed the advice on this page[1] and
set all the environment variables first (and also tried specifying
options to configure like --with-jpeg) but I'm still seeing this
error. (I also first tried it without any special options.)


Anyone know what's up? Anyone got RMagick working on MacOS X (Tiger)?


[1] http://grotto11.com/blog/archive/1060372029.shtml

Sorry you're having trouble, Gavin. Here's the way I recommend
installing RMagick on OSX:

http://rubyforge.org/forum/forum.php?thread_id=2092&forum_id=1618

There's a little typo in that post. There's not supposed to be a space
in the --with-gs-font-dir option when you're running ImageMagick's
configure. The correct option is:
--with-gs-font-dir=/opt/local/share/ghostscript/fonts

Good luck, and give me a shout if you run into trouble.
 
R

rmagick

Oops. Hate to reply to my own post, but...I don't read any mail that
comes to this gmail address. If you need to reach me you can email me
at rmagick at rubyforge dot org or cyclists at nc dot rr dot com.

We now return you to your regularly scheduled program...
 

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,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top