Super simple image resizing
December 3rd, 2007
Everyone knows ImageMagick is a goddam pain to install and a beast of a library to use for simple image resizing and cropping. ImageScience is on the way, but it's still easy to bump into issues compiling Freeimage. If all you want to do is resize (and crop) libgd is even more lightweight (and tiny enough to do away with DarwinPorts). With a bit of inline C we can do some really lean image resizing.
SfsResize (sfs_resize.rb) is a super simple image resizer. Compile libgd in a few minutes (there is an OS X how-to) and then use it like this:
w = 100
h = 100
s = SfsResize.new("in.gif")
s.resize_and_write_to_file("out.gif", w, h)
Severely untested, but good fun nevertheless.
Understanding Merb
December 2nd, 2007
If you're interested in learning more about innards of Merb, Ezra has written a brilliant walkthrough of the framework code. Merb's lightweight nature mean's this more of a Sunday stroll compared to the hike which Rails would involve.
Update: Shalev NessAiver has made a pretty diagram!





