[Seaside] (serve/) RENDER jpg image files from form objects

Martin Schubert mtin79 at googlemail.com
Wed May 31 22:14:33 UTC 2006


hey philippe,
thanks for reply. i allready had a look at the FileLibrary. i like  
it! but i want to save the jpg or png files or any kind of multimedia  
data directly in the data objects which get rendered.
so there is an instance of type 'Form' and which holds an jpg picture  
file. everything works perfect with gifs. but as soon as jpgs or png  
or other mime type come into the game its getting difficult.

i want the jpeg file (hold in a instance variable of type form) to be  
RENDERED. not only a link to the data.

>> html imageWithDocument: aForm bits asByteArray
>>                 mimeType: 'image/jpeg'
>>                 fileName: root name,'Picture', '.jpg'.

best

martin


Am 31.05.2006 um 22:37 schrieb Philippe Marschall:

> Hi
>
> If you want to do this with FileLibrary
> - Load the latest FileLibrary from the Seaside repository at  
> SqueakSource
> - go to your /seaside/config application and make sure there's an
> application of the type "Static File Library" named files (should
> happen automatically if you load FileLibrary-pmm.8 and had no previous
> version loaded)
> - create a subclass of WAFileLibrary named let's say MyFileLibrary
> - configure the files application, again in the  /seaside/config  
> application
> - add MyFileLibrary and configure it too
> - add/upload your 'wave.jpg' file (might take a moment)
> - in your seaside application you can use the following code
>
> html image: '/files/wave.jpg'
>
> You can check in MyFileLibrary into Monticello, file it out, make a
> changeset, .... it will take 'wave.jpg' everywhere it goes.
>
> Cheers
> Philippe
>
> 2006/5/31, Martin Schubert <martin.schubert at informatik.uni-ulm.de>:
>> hello out there,
>> allthough i browsed throught the archives i couldn`t find the answer
>> to my problem.
>>
>> i want to serve a jpg-file which is stored in a Form object.
>> so i do : aForm _ (Form fromFileNamed: 'wave.jpg')
>>
>> then i tried the following inside the #renderContentOn:  method :
>>
>> html imageWithDocument: aForm bits asByteArray
>>                 mimeType: 'image/jpeg'
>>                 fileName: root name,'Picture', '.jpg'.
>>
>> this doesn`t work, and when i am acceptin the following, seaside
>> seems to convert the jpg file to gif or wracks up the picture file
>> somehow :
>>
>>         html imageWithDocument: aForm
>>                 mimeType: 'image/jpeg'
>>                 fileName: root name,'Picture', '.jpg'.
>>
>> anybodys having some experience with this issue?
>> thanks for help!
>>
>> martin
>>
>> _______________________________________________
>> Seaside mailing list
>> Seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the Seaside mailing list