[Seaside] Re: html images

Frank Sukhu fsukhu at gmail.com
Sun Jul 9 17:07:16 UTC 2006


I am still trying to piece together how the machinery works but this tip
(see below)  from German has helped me.  As he suggested, I modified the
Form>asMIMEDocument to use a jpg type file instead of the default gif file;
this yielded better results.

Also, as others have mentioned, I probably have the depth to be an
inappropriate value.

What have I learned:

1. Using code like:  " html imageWithForm: (ImageReadWriter
formFromFileNamed: fn)." results in a gif file being served.  The gif file
has a default depth of 16.
2.  As mentioned (by David Shaffer in this thread), using option 1 is
wasteful.

Thanks for all the help,
Frank



"German Arduino" <gsa at arsol.net> wrote in message
news:e8r19q$mhf$1 at sea.gmane.org...
>
> AFAIK ImageReadWriter use Form which returns ever a gif from its method
> asMIMEDocument.
>
> I you change such method by:
>
> asMIMEDocument
> | aStream rw |
>
> aStream := RWBinaryOrTextStream on: String new.
> rw := PNGReadWriter on: aStream.
> rw nextPutImage: self.
> rw close.
> aStream reset.
> ^MIMEDocument contentType: 'image/png' content: aStream contents
>
> you will get the png correctly showed.
>
> HTH.
> gsa.





More information about the Seaside mailing list