[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RMagick on MacOS X (can't read a JPG

Gavin Kistner

5/18/2005 3:42:00 AM

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/106037...


4 Answers

Doug Beaver

5/18/2005 5:58:00 AM

0

On Wed, May 18, 2005 at 12:41:30PM +0900, Gavin Kistner wrote:
> 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

--
"Contrary to what most people say, the most dangerous animal in the
world is not the lion or the tiger or even the elephant. It's a shark
riding on an elephant's back, just trampling and eating everything they
see." -- Jack Handey


Gavin Kistner

5/18/2005 12:56:00 PM

0

On May 17, 2005, at 11:58 PM, Doug Beaver wrote:
> 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?

Tim Hunter

5/18/2005 7:25:00 PM

0

Gavin Kistner wrote:
> 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/106037...

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&for...

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.

Tim Hunter

5/18/2005 7:42:00 PM

0

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