Forum: Ruby Image Processing Questions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Be3f276f615e29a7c605efd1d3bc3cae?d=identicon&s=25 Mike Brum (Guest)
on 2006-05-10 15:41
(Received via mailing list)
I've been digging around trying to find a good hook for GD and so far
I've
found

Gruby (1): http://raa.ruby-lang.org/project/gruby/
Gruby (2): http://gruby.sourceforge.jp/index.en.html#download
Ruby-gd: http://raa.ruby-lang.org/project/ruby-gd/
GD2: http://rubyforge.org/projects/gd2/

GD2 seems to be the most-current with the file date of March 4, 2006.
However, when I run 'gem install GD2' I get some strange errors along
with
when I try to require GD2.

C:\Documents and Settings\Mike>gem install gd2
Attempting local installation of 'gd2'
Local gem file not found: gd2*.gem
Attempting remote installation of 'gd2'
Updating Gem source index for: http://gems.rubyforge.org
Successfully installed gd2-1.1
Installing RDoc documentation for gd2-1.1...

lib/gd2/image.rb:681:25: ':' not followed by identified or operator
lib/gd2/palette.rb:55:40: ':' not followed by identified or operator
lib/gd2/palette.rb:93:28: ':' not followed by identified or operator
lib/gd2/palette.rb:94:30: ':' not followed by identified or operator
lib/gd2/palette.rb:95:29: ':' not followed by identified or operator
lib/gd2/palette.rb:96:30: ':' not followed by identified or operator
lib/gd2/palette.rb:97:29: ':' not followed by identified or operator
lib/gd2/palette.rb:189:28: ':' not followed by identified or operator
lib/gd2/palette.rb:190:30: ':' not followed by identified or operator
lib/gd2/palette.rb:191:29: ':' not followed by identified or operator
lib/gd2/palette.rb:192:30: ':' not followed by identified or operator

C:\Documents and Settings\Mike>irb
irb(main):001:0> require 'GD2'
RuntimeError: unknown error
        from C:/Program
Files/ruby/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:29:in `initialize'
        from C:/Program
Files/ruby/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb:29
        from C:/Program
Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require'

        from C:/Program
Files/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:182:in
`activate'
        from C:/Program
Files/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:181:in
`activate'
        from C:/Program
Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:26:in
`require'

        from (irb):1
irb(main):002:0>

(condensed some whitespace)

What I'm wondering is

1) What do people use for image processing? I've always used GD when I
was
using PHP and it's just "what I'm used to". I'm not really married to
any
particular library as long as it has all of the functionality that GD
has.

2) Does anyone have any idea what went wrong with my GD gem install? I
tried
this on two XP sp2 systems and it yielded the same exact result (wanted
to
be sure it wasn't a localized problem). I also get the same results when
I
require GD2 on both machines (the other machine has Ruby installed to
C:\ruby - so I know the path in the example above isn't an issue).

Any insight is greatly appreciated!

Thanks

-M
E34b5cae57e0dd170114dba444e37852?d=identicon&s=25 Logan Capaldo (Guest)
on 2006-05-10 17:15
(Received via mailing list)
On May 10, 2006, at 9:37 AM, Mike Brum wrote:

> However, when I run 'gem install GD2' I get some strange errors
>
> lib/gd2/palette.rb:192:30: ':' not followed by identified or operator
> Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
> `require'
> using PHP and it's just "what I'm used to". I'm not really married
> require GD2 on both machines (the other machine has Ruby installed to
> C:\ruby - so I know the path in the example above isn't an issue).
>
> Any insight is greatly appreciated!
>
> Thanks
>
> -M
>

Seems like a bug in GD2. Have you looked at line 29 of
C:/Program Files/ruby/lib/ruby/gems/1.8/gems/gd2-1.1/lib/gd2.rb
?
0b561a629b87f0bbf71b45ee5a48febb?d=identicon&s=25 Dave Burt (Guest)
on 2006-05-10 17:55
(Received via mailing list)
Mike Brum wrote:
> 1) What do people use for image processing? I've always used GD when I was
> using PHP and it's just "what I'm used to". I'm not really married to any
> particular library as long as it has all of the functionality that GD has.

RMagick. I haven't really used GD, but I'm sure RMagick is cooler.

http://rmagick.rubyforge.org/

Cheers,
Dave
Be3f276f615e29a7c605efd1d3bc3cae?d=identicon&s=25 Mike Brum (Guest)
on 2006-05-10 18:42
(Received via mailing list)
> RMagick. I haven't really used GD, but I'm sure RMagick is cooler.
>
> http://rmagick.rubyforge.org/
>

I checked that out, but they unfortunately only have bindings for up to
1.8.2 on Windows and I'm running 1.8.4.

At least it looks like RMagick is being actively developed. Hopefully
it's
not too long until there's something I can use.

Thanks for the link though!

-M
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2006-05-10 19:23
(Received via mailing list)
On Thu, 11 May 2006, Mike Brum wrote:

>
> Thanks for the link though!
>
> -M

if you simply take the time to compile ruby yourself using msys then not
only
will you be able to run 1.8.4 but you'll be able to install rmagic,
narray,
gsl, etc. using the standard

   ruby extconf.rb && make && make install

if you use the one click you'll always need to wait for extension
writers to
compile for you.

fyi.

-a
0b561a629b87f0bbf71b45ee5a48febb?d=identicon&s=25 Dave Burt (Guest)
on 2006-05-11 10:54
(Received via mailing list)
Mike Brum wrote:
>> http://rmagick.rubyforge.org/
>>
>
> I checked that out, but they unfortunately only have bindings for up to
> 1.8.2 on Windows and I'm running 1.8.4.

What makes you say that? My setup works fine:

irb(main):009:0> Magick::Version
=> "RMagick 1.10.1"
irb(main):010:0> RUBY_VERSION
=> "1.8.4"

Cheers,
Dave
Be3f276f615e29a7c605efd1d3bc3cae?d=identicon&s=25 Mike Brum (Guest)
on 2006-05-11 14:43
(Received via mailing list)
> Dave
From the news section of the RMagick page:

http://rubyforge.org/forum/forum.php?forum_id=6439

It's certainly possible that I'm misinterperating what's being said
here.
Until Ruby, I haven't really had to deal with libraries and such, so
this is
a bit of a learning curve to me.

Thanks for the info though - I may just give it a shot.

-M
0b561a629b87f0bbf71b45ee5a48febb?d=identicon&s=25 Dave Burt (Guest)
on 2006-05-11 17:10
(Received via mailing list)
Mike Brum wrote:
>> Dave
>
>>From the news section of the RMagick page:
>
> http://rubyforge.org/forum/forum.php?forum_id=6439
>
> It's certainly possible that I'm misinterperating what's being said here.
> Until Ruby, I haven't really had to deal with libraries and such, so this is
> a bit of a learning curve to me.
>
> Thanks for the info though - I may just give it a shot.

Well read. Don't use it in production, but I believe it generally works.
 (I haven't used it in an application as such, just scripts.)

Many people are using versions of Iconv and Ruby 1.8.2 that were
compiled with different compilers (the opposite two to this case)
without major issues that I've heard of.

Cheers,
Dave
37a3c73ffbf864e4b28f7f2384ee12ce?d=identicon&s=25 Timothy Hunter (tim-hunter)
on 2006-05-12 02:04
(Received via mailing list)
A number of people reported that the RMagick 1.10.0 Win32 beta gem
caused problems in RoR applications that were using the 1.8.4 One
Click Installer version of Ruby, so I withdrew it until Kaspar could
acquire and install a different compiler and build a new gem. I don't
know if the beta gem causes problems with non-RoR applications.

See http://rubyforge.org/tracker/index.php?
func=detail&aid=4036&group_id=12&atid=133
114892d0cdbc61d4e686dac70495a22b?d=identicon&s=25 Rob Leslie (Guest)
on 2006-05-13 05:02
(Received via mailing list)
On May 10, 2006, at 6:37 AM, Mike Brum wrote:

> Installing RDoc documentation for gd2-1.1...
> lib/gd2/palette.rb:191:29: ':' not followed by identified or operator
> lib/gd2/palette.rb:192:30: ':' not followed by identified or operator

These warnings are harmless. RDoc doesn't seem to like symbols
constructed from string literals.

> `require'
>
>         from (irb):1

This error is more significant; Ruby/GD2 depends on the availability
of a GD dynamic library, and until version 1.1.1 released today, had
no direct support for the Win32 DLL peculiarities.

You might try installing the latest gd2 gem (1.1.1). I had some
success in brief testing, but there may still be issues. In
particular, there may be problems using bgd.dll with versions of Ruby
built under Cygwin. Versions built under mingw32 seem to work better.
This topic is locked and can not be replied to.