RMagick returns nil reading JPEG

Posted by ysproduction on Stack Overflow See other posts from Stack Overflow or by ysproduction
Published on 2010-03-29T16:00:16Z Indexed on 2010/03/29 16:03 UTC
Read the original article Hit count: 387

Filed under:
|
|
|
|

When I try to open a JPEG format file in Rails using RMagick, it always return nil with any jpg file. Other file formats open well.

$ script/console
Loading development environment (Rails 2.3.4)
>> require 'RMagick'
>> img = Image.read("1.gif").first
=> 1.gif GIF 230x100 230x100+0+0 PseudoClass 256c 8-bit 2kb
>> img = Image.read("1.png").first
=> 1.png PNG 1280x800 1280x800+0+0 DirectClass 8-bit 156kb
>> img = Image.read("1.jpg").first
=> nil

Why this happens?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about rmagick