Ok, here is the od output:

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

X:\avs_templates>od out\1\images\gd_2.png
0000000 050211 043516 005015 005032 000000 006400 044111 051104
0000020 000000 144000 000000 062000 001401 000000 174400 166510
0000040 000110 000000 050006 052114 000105 000000 000377 015400
0000060 106777 000042 000000 044610 040504 074124 166634 130720
0000100 001012 006061 170706 016600 122024 161375 114342 170507
0000120 037325 010360 136134 163334 055343 001604 150743 116115
0000140 017762 172062 044507 044251 165766 117360 141046 122413
0000160 002554 173024 106743 012560 151013 072716 146026 122625
0000200 005141 163602 015002 013026 112170 025635 101170 134567
0000220 036707 053507 055243 135427 100505 104127 176402 020716
0000240 175212 001036 027327 174230 173041 153360 133726 137535
0000260 100677 064062 066454 054404 062626 113131 137775 027427
0000300 015313 013305 123006 000375 000000 044400 047105 127104
0000320 060102 000202
0000323


The second image, gd_2.png works.  This was generated using tpage and
adding "| stdout(1)" to the im.png method.  Tpage would not create a
good image without the pipe.  If I left the pipe in when ttree ran, I
just got the output to the screen, and not in the file.

I moved the META directive inside the block w/ the GD code to make sure
that everything was within the [%- and -%].  The failing png does seem
to have the proper sizing info, but IE still shows an X were the image
should be.

> -----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