[Seaside] Problem showing a JPEG to the world
François Beausoleil
fbeausoleil at ftml.net
Thu May 26 22:17:27 CEST 2005
Jason Rogers said the following on 2005-05-26 14:31:
> 4. Test! Test! Test!
Hmm, there are no tests for MIMEDocument that I could find... Means I
should write some, I guess :)
At the moment, I changed the implementation thusly:
Form>>asMIMEDocument
| aStream contentType |
aStream := (RWBinaryOrTextStream on: '').
self depth < 8
ifTrue: [
GIFReadWriter putForm: self onStream: aStream.
contentType := 'image/gif']
ifFalse: [
self depth = 8
ifTrue: [
PNGReadWriter putForm: self onStream: aStream.
contentType := 'image/png']
ifFalse: [
JPEGReadWriter2 putForm: self onStream: aStream.
contentType := 'image/jpeg']].
^MIMEDocument contentType: contentType content: aStream contents
Works fine for my current needs. I'll look into changing Seaside
appropriately.
Thanks !
François
More information about the Seaside
mailing list