He's talking about a generated image, not one on the file system.

Generally in this case you just take the stream you have and use getOutputStream() and push the two together.

You'll need to write a separate element for it because browsers expect only image content.

On 12/7/05, Geert Bevin < [EMAIL PROTECTED]> wrote:
Just an example:
public class ServeImage extends Element
{
     public void processElement()
     {
         try
         {
             File file = new File("/path/to/rife-logo.png");
             setContentType("image/png");
             setContentLength((int)file.length());
             FileInputStream is = new FileInputStream(file);
             FileUtils.copy(is, getOutputStream());
         }
         catch (Exception e)
         {
             throw new RuntimeException(e);
         }
     }
}

On 07 Dec 2005, at 19:22, Geert Bevin wrote:

> Hi Matthias,
>
> no there's no shortcut for that. You typically just write an
> element for it that streams to bytes straight through. Then you
> reference it as a regular image.
>
> Hope that helps.
>
> Best regards,
>
> Geert
>
> On 7-dec-05, at 18:27, Matthias Schmitt wrote:
>
>> Hello,
>>
>> how can i display a generated jpeg with rife?
>>
>> i've got stream with jpeg content and try to insert it into at
>> template.
>> Something like DatabaseImageStore getContenforHtml(..),
>> but without the Database.
>>
>> Is there a short way?
>>
>> --
>> Matthias Schmitt
>> _______________________________________________
>> Rife-users mailing list
>> [email protected]
>> http://www.uwyn.com/mailman/listinfo/rife-users
>>
>
> --
> Geert Bevin                       Uwyn bvba
> "Use what you need"               Avenue de Scailmont 34
> http://www.uwyn.com               7170 Manage, Belgium
> gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03
>
> PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
> Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net
>
>
> _______________________________________________
> Rife-users mailing list
> [email protected]
> http://www.uwyn.com/mailman/listinfo/rife-users
>

--
Geert Bevin                       Uwyn bvba
"Use what you need"               Avenue de Scailmont 34
http://www.uwyn.com               7170 Manage
gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net



_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users



--
JR Boyens
[EMAIL PROTECTED]
_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users

Reply via email to