Archive

Posts Tagged ‘rmagick4j’

Status Update: RMagick4J, Nokogiri, ruby2java and a possible MagickWand4J

June 6th, 2009 Serabe No comments

It’s been long time since last status update, but there are some things to tell, so here I am.

Thankfully, this year I’m a GSoC student again (and my mentor is Tom too). The main part of my project would be porting Nokogiri to JRuby, so I haven’t code for RMagick for a while now.

Let’s start with the status update then.

Nokogiri

I’ve been working on Nokogiri for a while. I forked Charles’ repo in Github, and I’ve implemented some cool features. For example, today I got my XML::Reader implementation to pass all tests in test_reader.rb. I hope I’ll be able to make a release this month (cross your fingers).

On the other hand, I got my first patch accepted in Nokogiri’s main repo.

RMagick4J

Not to much work done here, sorry. I haven’t code anything for a while now. Migrating from mercurial to git is already planned, but before that I would like to do a few commits more. Anyway, I’m quite happy with this project. Some people are using it and reporting bugs (in the end, those little things are all that matters). What else can I ask for?

Please, if you find a bug, report it here.

MagickWand

Tim Hunter (creator of RMagick) released MagickWand recently. I’ve been considering porting it to JRuby too. I have to take a deeper look at the C code, but, by now, I think it could be a good way to lead RMagick4J development. If finally I port it, I will split RMagick4J in two projects (Magick4J and RMagick4J). This way, MagickWand4J and RMagick4J would share the same java codebase, as MagickWand and RMagick share ImageMagick.

ruby2java

Take a look here. Awesome, isn’t it? And as soon as I have some time to work on it, siesta will be out too…

P.D. By the way, no more personal stuff in this blog. That stuff is now here, and only in Spanish (sorry about that).

article clipper Status Update: RMagick4J, Nokogiri, ruby2java and a possible MagickWand4J
 
share save 171 16 Status Update: RMagick4J, Nokogiri, ruby2java and a possible MagickWand4J

RMagick4J 0.3.7 Happy Birthmonth released.

March 23rd, 2009 Serabe No comments

RMagick4J 0.3.7 Happy Birthmonth has been released!

RMagick is a Ruby binding to ImageMagick and GraphicsMagick. RMagick4J implements ImageMagick functionality and the C portions of RMagick for use with JRuby.

Current stable version: 0.3.7
Project URL: http://kenai.com/projects/rmagick4j
Installation: gem install rmagick4j

New effects:

  • Charcoal
  • Edge
  • Implode
  • Negate
  • Normalize
  • Shade
  • Solarize
  • Wave

(I think that’s all that you need to use simple_captcha)

Major bugs resolved:

  • blur_image produced different images from RMagick.
  • Draw#push and Draw#pop didn’t work correctly in some cases.

Furthermore, RMagick4J does not depend on jhlabs library anymore (the gem has lost some weight!).

Thanks to:

  • Tim Hunter and the ImageMagick team (obviously).
  • JRuby community for its support.
  • Everyone that has reported a bug, ask for help in the #jruby channel or suggest a new library compatibility.

Please try out your applications with rmagick4j and help us provide feedback (even birthmonth cake!). It is our goal to make a fully-compatible implementation of RMagick4j in JRuby.

You have some image examples here: http://www.serabe.com/rmagick4j

This is a very special release, cause March is my birthmonth.

Happy Birthmonth to:

  • SuperTaz
  • everyone else whose birthmonth is march
  • and me!
article clipper RMagick4J 0.3.7 Happy Birthmonth released.
 
share save 171 16 RMagick4J 0.3.7 Happy Birthmonth released.

RMagick4J: status update

February 27th, 2009 Serabe No comments

In first place, my apologies if the lack of a new release or new feature is disturbing someone.

Currently, I’m working on new effects and I need a good convolve method for them to work. In the begining, I tried to replicate the convolve method, but finally I prefer to use the ConvolveOp class, expanding the image previously for replicating some ImageMagick functionality about surrounding pixels (Java has only two options while ImageMagick has a few more). And here is the problem. I cannot get the bunch of code working. Maybe, I’m overlooking something; maybe I’m not. If I cannot get it working in two days or so, I will ask (or even cry) for help.

End of report.

article clipper RMagick4J: status update
 
share save 171 16 RMagick4J: status update
Categories: JRuby, Programming, Ruby Tags: , ,

Why I like JRuby

November 7th, 2008 Serabe No comments

Some days ago Tom forwarded me an email from Mikael Lammentausta. Mikael found an issue with rmagick4j. Using this Mikael’s script

[ruby]
require ‘rubygems’
require ‘gruff’

def basic_graph()
g = Gruff::Line.new
g.theme = {
:colors => ['#7F0099', '#2F85ED', '#2FED09','#EC962F'],
:marker_color => ‘#aaa’,
:background_colors => ['#E8E8E8','#B9FD6C']
}
g.hide_title = true

g.legend_font_size = 12
g.marker_font_size = 16
g.hide_dots = false

return g
end

def bmi(params={})
g = basic_graph()

g.y_axis_label = ‘BMI’

bmis = [24.3, 23.9, 23.7, 23.7, 23.6, 23.9, 23.6, 23.7, 23.4, 23.4, 23.4, 22.9]

g.data( ‘BMI’, bmis )
g.hide_legend = true
return g
end

g=bmi
g.write ‘graph.jpg’
[/ruby]

You get two different outputs.

graph 300x225 Why I like JRuby

MRI-generated

graph1 300x225 Why I like JRuby

JRuby

As you may see, the numbers are wrong in JRuby… or not.

Looking at gruff code, I saw the problem was in the label method.

[ruby]
def label(value)
if (@spread.to_f % @marker_count.to_f == 0) || !@y_axis_increment.nil?
return value.to_i.to_s
end
if @spread > 10.0
sprintf(“%0i”, value)
elsif @spread >= 3.0
sprintf(“%0.2f”, value)
else
value.to_s
end
end
[/ruby]

The problem can be found in line 10. With a right input, you can make

[ruby]
(@spread.to_f % @marker_count.to_f == 0) || !@y_axis_increment.nil?
[/ruby]

false and have a @spread < 3.0. Then look at this code:

[ruby]
i = 23.599999999999998
puts i
[/ruby]

In JRuby, you get what you expect 23.599999999999998 but, in MRI, you get 23.6. So, that was the problem. JRuby is more precise than MRI.

NOTE:
jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-03 rev 7996) [i386-java]
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]

article clipper Why I like JRuby
 
share save 171 16 Why I like JRuby
Categories: General, JRuby, Programming, Ruby Tags: , , ,

RMagick4J 0.3.6

August 16th, 2008 Serabe No comments

I am glad to announce a new version of rmagick4j.

RMagick4J aims to implement the ImageMagick funcionality and the C
portions of RMagick for make it works in JRuby.

Current stable version: 0.3.6
Project URL: http://code.google.com/p/rmagick4j/
Installation: gem install rmagick4j

Google Summer of Code project should be thanked for making this new
release possible.

In release 0.3.6 you can find the next improvements:

  • More Draw primitives (clip-path [creatin a clip-path and using a
    clip-path], fill-rule, rotate, scale [reimplemented], skewX, slewY,
    stroke-linecap, stroke-linejoin, stroke-miterlimit, translate).
  • Solve a bug with transparent stroke and line primitive.
  • Added the following Draw instance methods:
    • annotate
    • get_multiline_type_metrics
  • Solved a bug that caused the background become black while resizing
    images with alpha channel.

Please try out your applications with rmagick4j and help us provide
feedback. It is our goal to make a fully-compatible implementation of
RMagick4j in JRuby.

article clipper RMagick4J 0.3.6
 
share save 171 16 RMagick4J 0.3.6

New RMagick4J release.

July 9th, 2008 Serabe 1 comment

RMagick aims to implement the ImageMagick funcionality and the C portions of RMagick for make it works in JRuby.

Current stable version: 0.3.5
Project URL: http://code.google.com/p/rmagick4j/
Installation: gem install rmagick4j

Google Summer of Code project should be thanked for making this new release possible.

In release 0.3.5 the following improvements have been made:

  • Implemented Draw primitives (affice, arc, pattern, path).
  • Improved Image and ImageList:
  • Implemented more of Pixel (from_HSL, to_HSL, <=>, fcmp, intensity).
  • Implemented the fill classes.
  • Added a side-by-side (MRI vs JRuby) image testing tool named Bullseye.
  • Added 680 color names. It can search, but not retrieve the name correctly capitalized.
  • Changed gem name from RMagick4J to rmagick4j.

This version should allow Gruff Graphs and Ruports to largely work without issues. Please try out your applications with rmagick4j and help us provide feedback. It is our goal to make a fully-compatible implementation of RMagick4j in JRuby.

article clipper New RMagick4J release.
 
share save 171 16 New RMagick4J release.

Ay, Serabe, que no haces nada ni tan siquiera regular.

May 18th, 2008 Serabe 3 comments

Hoy me he tirado unas cuatro horas para encontrar un bug, uno de estos puñeteros bichos que te atrapan y te dejan cosas como estas:
black Ay, Serabe, que no haces nada ni tan siquiera regular.
Para que os hagáis una idea, tenía que ser esto:
really black Ay, Serabe, que no haces nada ni tan siquiera regular.
Como se puede apreciar, son sensiblemente diferentes. Así que cuatro horas de mi vida han transformado lo primero, en lo segundo.

El problema venía en que, tal y como Tom (mi mentor del GSoC) propuso, se ha cambiado la clase PixelPacket de forma que ahora trabaja con enteros. El problema, mejor no os lo cuento que es más aburrido que lo anterior.

En fin, que hoy me voy a la cama con un ego más grande que el de Enrique Dans.

article clipper Ay, Serabe, que no haces nada ni tan siquiera regular.
 
share save 171 16 Ay, Serabe, que no haces nada ni tan siquiera regular.