Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: Omer Bar-or
RE: Patch: The newer I.M. only takes num. or % [ reply ]  
2009-12-21 10:46
A patch for this issue has been committed. I used a slightly different solution than your colleague's in order to make sure that RMagick works for people with old versions of ImageMagick too and to keep RMagick behavior close to that of ImageMagick.

You can see the bug and description of the solution here: http://rubyforge.org/tracker/index.php?func=detail&aid=27607&group_id=12&atid=133 (forgive the funky bug name).

By: Omer Bar-or
RE: Patch: The newer I.M. only takes num. or % [ reply ]  
2009-12-17 07:44
Hi, Arthur -

I verified the bug. Good catch!

And, thanks to your colleague and to you for the patch and the test case. They'll both be very helpful.

Thanks,
- Omer.

By: Arthur Chan
RE: Patch: The newer I.M. only takes num. or % [ reply ]  
2009-12-17 07:01
An E.g. to produce the errors
=======================

<code>
require 'rmagick'
Magick::Pixel.from_color("red")
hsla = Magick::Pixel.from_color("red").to_hsla
Magick::Pixel.from_hsla(hsla[0],hsla[1],hsla[2],hsla[3])
</code>

Before patch (wrong):
<code>
irb(main):001:0> require 'rmagick'
=> true
irb(main):002:0> Magick::Pixel.from_color("red")
=> red=65535, green=0, blue=0, opacity=0
irb(main):003:0> hsla = Magick::Pixel.from_color("red").to_hsla
=> [0.0, 100.0, 50.0, 1.0]
irb(main):004:0> Magick::Pixel.from_hsla(hsla[0],hsla[1],hsla[2],hsla[3])
=> red=17889, green=7811, blue=7811, opacity=0
irb(main):005:0>
</code>

After patch (correct):
<code>
irb(main):001:0> require 'rmagick'
=> true
irb(main):002:0> Magick::Pixel.from_color("red")
=> red=65535, green=0, blue=0, opacity=0
irb(main):003:0> hsla = Magick::Pixel.from_color("red").to_hsla
=> [0.0, 100.0, 50.0, 1.0]
irb(main):004:0> Magick::Pixel.from_hsla(hsla[0],hsla[1],hsla[2],hsla[3])
=> red=65535, green=0, blue=0, opacity=0
irb(main):005:0>
</code>

By: Arthur Chan
RE: Patch: The newer I.M. only takes num. or % [ reply ]  
2009-12-17 03:20
FYI, the bugs found in IM versions > 6.5.3.

For more info, you may visit: http://github.com/arthurccube/RMagick.

By: Arthur Chan
Patch: The newer I.M. only takes num. or % [ reply ]  
2009-12-17 03:17
Hi Guys,

There is a bug in RMagick for the latest ImageMagick.

The patch is from my colleague.

I've posted a patch in the following links.

http://github.com/arthurccube/RMagick/blob/master/0002-fixed-from_hsla-for-newer-ImageMagick-versions-6.5.3.patch


Arthur