[Seaside] Problem showing a JPEG to the world

Tony Garnock-Jones tonyg at lshift.net
Thu May 26 17:29:18 CEST 2005


seaside at fbeausoleil.ftml.net wrote:
> I'm having a problem putting a picture out.  I'm doing this in my 
> renderContentOn:
> 
>   html imageWithForm: ((pict picture) scaledToSize: 220 at 165).
> 
> imageWithForm: renders the image as a GIF, using the web palette.  The 
> original image is a JPEG, and I would like to output it as such.

Look at Form>>asMIMEDocument, which reads as follows in Seaside 2.5b3:

asMIMEDocument
	| aStream |
	aStream := (RWBinaryOrTextStream on: '').
	GIFReadWriter putForm: (self asFormOfDepth: 8)
		onStream: aStream.
	^MIMEDocument contentType: 'image/gif' content: aStream contents

Regards,
   Tony
-- 
  [][][] Tony Garnock-Jones     | Mob: +44 (0)7905 974 211
    [][] LShift Ltd             | Tel: +44 (0)20 7729 7060
  []  [] http://www.lshift.net/ | Email: tonyg at lshift.net


More information about the Seaside mailing list