I just implemented this and one problem, all items in the tree are being "process"'ed with a wrapper, so ttree wrapped the png file. Hmm, back to the redirect filter.
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] On Behalf Of > Craig Barratt > Sent: Monday, February 04, 2002 4:48 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [Templates] GD > > > > I was looking at the GD modules and I was puzzled by the > examples. If > > I have a file in my tree which contains GD module code, what get's > > produced? Is the file that get's created in the dest dir > animage? Do > > I need to wrap the GD directives in a re direct filter? > The examples, > > though explicit in image creation, are vauge in what > happens after t > > he template is processed. > > The examples in the documentation show how to produce images. > By default, these get written to where ever the output is > going, along with any other output. You therefore need to > make sure that no output is generated by the rest of the > file. The examples in the documentation explicitly write the > output to stdout, which you probably don't want to do with ttree. > > I haven't used ttree, so here's a guess of one way to set it > up. You could, for example, create a file test.png that > contains just this (ie: no other whitespace before the [% ... -%]): > > [% > USE gdc = GD.Constants; > USE im = GD.Image(200,100); > black = im.colorAllocate(0 ,0, 0); > red = im.colorAllocate(255,0, 0); > r = im.string(gdc.gdLargeFont, 10, 10, "Large Red Text", red); > im.png; > -%] > > Provided you comment out this line in your .ttreerc: > > copy = \.png$ > > then ttree will process test.png in the source directory and > produce an image test.png in the destination directory. > > If ttree did mangling of extension names (not sure if it > does) then you could call your source file something like > test.png.src or similar and have the output go to test.png. > > Craig > > _______________________________________________ > templates mailing list > [EMAIL PROTECTED] > http://www.template-> toolkit.org/mailman/listinfo/templates >
