Just an add-on, I just did this at the command line:

X:\avs_templates>ttree -s .\1\images -d .\out\1\images -a

And the resulting png is still no-good, and here is the od output:

X:\avs_templates>od out\1\images\gd.png
0000000 050211 043516 006415 015012 005015 000000 006400 044111
0000020 051104 000000 144000 000000 062000 001401 000000 174400
0000040 166510 000110 000000 050006 052114 000105 000000 000377
0000060 015400 106777 000042 000000 044610 040504 074124 166634
0000100 130720 005015 030402 143014 100361 012035 176644 161342
0000120 043630 152761 170076 056020 156274 161746 102132 161403
0000140 046721 171234 031037 043764 124511 173110 170353 023236
0000160 005702 066245 012005 161766 070215 005425 147322 013165
0000200 112714 060645 005015 163602 015002 013026 112170 025635
0000220 101170 134567 036707 053507 055243 135427 100505 104127
0000240 176402 020716 175212 001036 027327 174230 173041 153360
0000260 133726 137535 100677 064062 066454 054404 062626 113131
0000300 137775 027427 015313 013305 123006 000375 000000 044400
0000320 047105 127104 060102 000202
0000327

> -----Original Message-----
> From: Craig Barratt [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, February 11, 2002 12:59 PM
> To: [EMAIL PROTECTED]
> Cc: 'Andy Wardley'; [EMAIL PROTECTED]
> Subject: Re: [Templates] GD 
> 
> 
> > So, I have this in my gd.png file:
> > 
> > [% META nowrap=1 %]
> > [%-
> >         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;
> > -%]
> > 
> > And this in the "process" file:
> > 
> > [%- 
> >     IF template.nowrap;
> >         PROCESS $template | trim;
> >         RETURN;
> >     END;
> >     
> >     WRAPPER page.tt2; PROCESS $template; END
> > -%]
> > 
> > Now, this works with tpage, but for some reason, ttree winds up 
> > creating a corrupt image file.  I checked, and ttree is not 
> wrapping 
> > the file, but the contents are NG.  Ideas?
> 
> Here are some things to check:
> 
>   - did you remove the output gd.png file and do a fresh run of ttree?
> 
>   - use od to compare the binary output files generated by 
> tpage and ttree.
>     Are they different sizes?  Where are they different?
> 
>   - You probably shouldn't run the gd file through trim:
> 
> >         PROCESS $template | trim;
> 
>     since it could contain leading or trailing whitespace (although
>     png files don't start with whitespace; I'm not sure about the last
>     bytes.  Your sample png file doesn't start or end with whitespace,
>     so the trim is a no-op).
> 
> Craig
> 



Reply via email to