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
On 5/29/05, Brent Pinkney brent.pinkney@aircom.co.za wrote:
Please advise if this is useful - it does facilitate using posh functions like
html imageMapWithAction: [ :x | x halt. ] form: (WAForm formFromFileNamed: 'map.png')
Hi Brent,
This would be very useful, but - what degree of caching does it do? Does it cache the PNG data in the image? And does it allow the browser to cache the image on the client side (by having equal WAForm objects be #= to each other so that they get the same URL)?
Avi
This would be very useful, but - what degree of caching does it do?
Does it cache the PNG data in the image?
Its #asMimeDocument method is very similar to Form's - except it can twiddle the ImageReadWrite subclass to instanciate as it is aware of the mime content type.
It does NOT read from the file after it has been instanciated - you will know more about whether that constitutes caching :)
And does it allow the browser to cache the image on the client side (by having equal WAForm objects be #= to each other so that they get the same URL)?
It didn't but the attached version does. Tested in Opera and Firefox.
Regards
Brent
Hi,
Please confirm that you have loaded both the mimeTypesFor-brp.1 and waForm-brp.2 changesets.
Can you put a 'self halt.' in WAForm>>asMIMEDocument and reload you page with a new session.
Please confirm that
a) the method halts in WAForm (not Form) b) the contentType is 'image/png' c) the depth is correct (> 8) d) the correct readerClass is answered
Thanks
Brent
Ok, both changesets has been loaded. On a), it does not halt, but gives me a MessageNotUnderstood: SmallInteger>>do: ... (I dont know how to capture the text in the error dialog).
b) and c) is ok, when it comes to d), I am not sure what you mean..
Chris
Brent Pinkney wrote:
Hi,
Please confirm that you have loaded both the mimeTypesFor-brp.1 and waForm-brp.2 changesets.
Can you put a 'self halt.' in WAForm>>asMIMEDocument and reload you page with a new session.
Please confirm that
a) the method halts in WAForm (not Form) b) the contentType is 'image/png' c) the depth is correct (> 8) d) the correct readerClass is answered
Thanks
Brent
Seaside mailing list Seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/listinfo/seaside
Filing in the changesets into a fresh image (the newest provided by Avi) yielded correct results, I can see now, sorry to bother you...
Chris
seaside@lists.squeakfoundation.org