Seaside and images

Avi Bryant avi at beta4.com
Wed Oct 8 18:42:23 UTC 2003


On Wednesday, October 8, 2003, at 08:51 AM, 
Torsten.Bergmann at phaidros.com wrote:

> Hi,
>
> the few seaside examples out there are text based.
> Does anyone have an idea how to use resources
> like GIF, PNG, ... in the framework?
>
> The only example I've found is seaside/screenshot
> which creates a gif from the desktop on the fly.
> Is there any support for using files from hard disk?

Hi Torsten,

There are a couple of different ways to do this.  One is to bring the 
resource into the image (for example into ImageImports), and then use 
the same mechanism that the screenshot app does:

html imageWithForm: (ImageImports at: #myImage).

I personally like this option because it makes deployment very easy 
(all you need to copy around is the single .image file).  The other 
possibility is to use another web server (Apache, or ModFile in 
Comanche, for example) to serve static resources.  You can then just 
put the URL in directly:

html image: '/resources/myimage.gif'.

One thing to note about the first option is that it uses Comanche's 
#asWebImage method to convert a Form into a MIMEDocument, which by 
default creates a somewhat low quality GIF.  You may want to tweak this 
to use a better encoding.



More information about the Squeak-dev mailing list