Monday, February 18, 2008

Code: Auto-thumbnail using Magick


def auto_thumbnail
@board = Board.find(params["id"])
pic = Magick::Image.read(@board.thumbnail_image).first
thumb = pic.resize(200, 145)
@response.headers["Content-type"]= thumb.mime_type
render :text => thumb.to_blob
end