|
From: Daniel J S. <dan...@ie...> - 2005-12-30 21:46:45
|
> Please try the attached patchset. > It fixes that issue and a number of other minor bugs like not reporting > the optimization setting when the terminal is in animation mode. The GIF-A now works directly into gthumb. However, the gifsicle conversion complains [sebald@local gif]$ gifsicle -l=1 test.gif > test10.gif gifsicle: Error while reading 'test.gif' frame #20: gifsicle: trailing garbage after GIF ignored and I've noticed that the file is about 33 bytes longer now that the gdImageGifAnimEnd is called. The size is still large compared to what gifsicle creates. >>I see why the comment is there; because the closing of the file is >>done in term.c. Now I think there should be, and I'm surprised there >>already isn't, a terminal function for finishing a file, e.g., >> >><term>_finishfile >><term>_wrapup >> >>I would think other formats that use compression and such might need >>to also have a wrap-up routine. > > > I have added a terminal flag TERM_CALL_ON_CLOSE > that a terminal can set if it wants to be called before the output file > is closed. If it is set, then the core code will call back via > term->layer(TERM_LAYER_END_MULTI_FRAME_SEQUENCE). > > It may be worth creating a separate terminal entry point, as you say. > On the other hand I think that this is in fact a "layer" boundary of a > sort. I could imagine calling it after a sequence of images in a > postscript output file, for instance, to cause the driver to emit an > accumulated BoundingBox and other per-document meta information. > > It's tricky, because the terminal type itself may have changed by the > time the output file is closed. I thought that was disallowed; a philosophical no-no. What you've done with term->layer hasn't circumvented the problem, I think. It's a matter of choice. I too thought of adding a variable to some function call. To me, TERM_graphics() seemed the logical choice. But then I thought, oh my, all those terminals using _graphics() would need a conditional statement to check if it were at the start of the file or end of the file. You chose a routine having very little use, so that made things a little easier. I keep snooping around with the file size issue, then put together a FAQ. Dan |