Archive for March, 2007

RMagick::RVG : outputting an inline image (or the horrid no decode delegate for this image format `' error)

Thursday, March 8th, 2007

Ruby is all nice and all, but some things are just either very poorely documented or just don't work very seamlessly sometimes. I have spend over an hour today trying to identify what is going on with RMagick::RVG not wanting to output an inline image for me.

The error I was getting was:

no decode delegate for this image format `'

And the code was as simple as contents of my brain in the early morning:

Magick::RVG.dpi = 72

rvg = Magick::RVG.new(320, 320).viewbox(0,0,320,320) do |canvas|
canvas.background_fill = 'red'
end

img = rvg.draw

send_data img.to_blob,
:filename => "woohoo.png",
:disposition => 'inline',
:quality => 90,
:type => 'image/png'

Everything seems to be fine and as I'm setting the image type in the to_blog thingy, I somehow assume there should be no problems decoding the image. Well I was wrong! In order to get rid of the bloody no decode delegate for this image format `' you have to specify the image format you want to image to be in, manually.

Behold the magic!

Magick::RVG.dpi = 72

rvg = Magick::RVG.new(320, 320).viewbox(0,0,320,320) do |canvas|
canvas.background_fill = 'red'
end

img = rvg.draw

img.format = "png" #FORGET THIS LINE AND DIE A HORRIBLE DEATH!! :)

send_data rvg.draw.to_blob,
:filename => "woohoo.png",
:disposition => 'inline',
:quality => 90,
:type => 'image/png'

Well.. that's it :) Hopefully it will help someone to save an hour or two ;)

Easy SWF Plugin 1.1

Monday, March 5th, 2007

The new version of my Easy SWF Plugin for WordPress is out today!

There were lots of requests to add background and included Flash size settings. And this update adds just that :) Continue reading! (more…)

Sharp 910sh (mini-look?)

Saturday, March 3rd, 2007

I got a new mobile phone this week :) After having been using Sharp 903sh for a year (and here's my first look at it), I have decided it's time for something new :) And it happened to be Softbank's new Sharp 910sh (the silvery one on the photos below, and the black one is my old Sharp 903sh)

dscf3943.jpg dscf3944.jpg dscf3945.jpg dscf3946.jpg

(more…)