From: Kirk Haines Date: 2004-08-09T09:35:42+09:00 Subject: Re: ANN: Iowa 0.9 Released On Mon, 9 Aug 2004 02:30:20 +0900, Michael Neumann wrote > This sounds really good. But is it possible to generate "real" images > (jpg, png) on-the-fly? Generating the image is no problem, but > associating the image data with an URL is a bit harder. I tried this > in Borges, and it did work, but it was a bit awkward IIRC. Okay. I worked on this a bit today, and it has proved pretty simple. To use it one writes a method that generates the image data and then calls session.resource_url with the image data and the mime type. That method will return the URL that will access the image data. def image # blah blah whatever you have to do to generate the image data. session.resource_url(image_data,'image/gif') end Then in your HTML, just put the call to image wherever you need the URL: Inline generated image That's it. Easy to use. I think I will setup session.resource_url so that it can take a block. If you call it as above, the resource is generated when the page that references it is generated, then cached until retrieved. If one passes in a block, the block will be responsible for generating the resource data, and thus resource generation can be defered until it is actually requested, and it need not be cached at all. Kirk Haines