Problems in web image handling

Avi Bryant avi at beta4.com
Fri Feb 6 11:58:44 UTC 2004


On Feb 6, 2004, at 3:21 AM, Cees de Groot wrote:

> Hi,
>
> I am fond of using image imports with Seaside in order to keep static
> images around in the, err, image (oh gosh, this is going to be
> complicated). A typical class-side method looks like:
>
> MyFrame class>>logo
>     ^Imports default imports at: #myLogo
> 	ifAbsentPut: [Form fromFileNamed: 'mylogo.gif']
>
> Use in Seaside is through the method #imageWithForm: which, at the end
> of the day, uses Form>>asWebImage to display the actual gif.
>
> The problem is - the gif that ends up being displayed in the browser
> is decidedly different from the 'original artwork' on disk. Compare for
> example http://tai42.xs4all.nl/~cg/lotus8-bars.gif with
> http://www.admorphis.com/en/@cMfxCHNWOiJyKfmP - in this particular 
> case,
> the colors are mostly the same but white dots appear in the 'munged'
> image that are not in the original.
>
> Is there something I'm missing here?

One problem may be that #asWebImage downgrades the GIF to 8 bit color 
(why, I have no idea).  My development branch of Seaside has stopped 
using it for exactly that reason.

However, it still seems a little silly to convert GIF->Form->GIF when 
you could just hold onto the original bytes.  I'll point out that you 
can actually pass to #imageWithForm: any object that responds to 
#asMIMEDocument, #width, and #height.  You might play with creating a 
GIFFile object that can handle these properly.  In fact, Seaside really 
ought to come with such a class...




More information about the Squeak-dev mailing list