With stdout(1) system outputs a lot of symbols without sense.
For example this following code from Template::Plugin::GD::Image documentation 
that I inserted in my table row:

      <tr><td>

    [% FILTER null;
        USE im = GD.Image(100,100);
        # allocate some colors
        black = im.colorAllocate(0,   0, 0);
        red   = im.colorAllocate(255,0,  0);
        blue  = im.colorAllocate(0,  0,  255);
        # Draw a blue oval
        im.arc(50,50,95,75,0,360,blue);
        # And fill it with red
        im.fill(50,50,red);
        # Output binary image in PNG format
        im.png | stdout(1);
       END;
    -%]

outputs binary symbols without sense.
How can solve this problem?


      </td></tr>

--- Ven 9/4/10, Randy J. Ray <[email protected]> ha scritto:

> Da: Randy J. Ray <[email protected]>
> Oggetto: Re: [Templates] Template::Plugin::GD usage
> A: "dark0s" <[email protected]>
> Cc: [email protected]
> Data: Venerdì 9 Aprile 2010, 19:18
> dark0s wrote:
> > I've the following code:
> > 
> >     <tr><td>
> > 
> >     [% FILTER null;
> >           
>    USE GD;
> > 
> >        img =
> GD.image('/var/www/upload/savio.jpeg');
> >        img.jpeg;
> > 
> >        END;
> >     %]
> > 
> >     </td></tr>
> > 
> > I have the following questions:
> > 1) Why I need FILTER...END block?
> > 2) Why I don't have output
> 
> If you read the docs for Template::Plugin::GD::Image (which
> you seem to have based your code snippet on), it explains
> why you use the null filter. Also, the examples in the
> documentation pipe the "img.jpeg" (or similar) through
> stdout(1), which produces the output. You've left that part
> out.
> 
> Randy
> --
> """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
> Randy J. Ray      Sunnyvale, CA   
>   http://www.rjray.org   [email protected]
> 
> Silicon Valley Scale Modelers: http://www.svsm.org
> 


      

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to