[Seaside] Re: html images

Michel Bany m.bany at wanadoo.fr
Sun Jul 9 14:35:45 UTC 2006


German Arduino a écrit :

>
> 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.
>
I believe there will be no need to change asMIMEDocument if you use this :

    html imageWithFileNamed:  fn

Using the above ensures that the image does not get unnecessarily 
converted to gif.
HTH
Michel.


More information about the Seaside mailing list