[Seaside] [ENH] WAForm to prevent degradation of rendered images

Brent Pinkney brent.pinkney at aircom.co.za
Sun May 29 21:58:32 CEST 2005


Hi,

I am battling to get images to be rendered correctly.

This problem has appeared on the list before and is caused by the Seaside  
API which (correctly) expects a Form instance as opposed to a file name.

However, the the implementation of Form>>asMIMEDocument renders the Form  
as a GIF image with 8 bit depth.

This caused horrible degradation.

Since it is very useful to use filenames in the early part of development,  
I have implemented WAForm as a subclass of Form which remembers its  
contentType.

WAForm overrides asMIMEDocument to answer a document with the original  
encoding an depth.

This changeset requires a wee fix mimeTypesFor-brp, which is attached.

Please advise if this is useful - it does facilitate using posh functions  
like

	html imageMapWithAction: [ :x | x halt. ]
		form: (WAForm formFromFileNamed: 'map.png')

Regards

-- 
Brent Pinkney
Aircom International (SA)
cell: +27 83 518 4167
tel: +27 11 324 3615
fax: +27 11 784 8027
e-mail: brent.pinkney at aircom.co.za
-------------- next part --------------
A non-text attachment was scrubbed...
Name: waForm-brp.1.cs.gz
Type: application/x-gzip
Size: 993 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20050529/3e4910bd/waForm-brp.1.cs.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mimeTypesFor-brp.1.cs.gz
Type: application/x-gzip
Size: 675 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20050529/3e4910bd/mimeTypesFor-brp.1.cs.bin


More information about the Seaside mailing list