pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] Patch for the Flate filter


From: gerel
Subject: Re: [pdf-devel] Patch for the Flate filter
Date: Fri, 03 Oct 2008 18:49:30 -0700 (PDT)

 > Date: Fri, 03 Oct 2008 16:19:18 +0200
 > From: address@hidden
 > 
 >       > What is the concrete problem with the flate encoder?
 > 
 >       I hope what I said above helps on this one. :-)
 > 
 >    Ok, I will modify the algorithms to support this:
 > 
 > 
 >       - finish_p will be activated with the input buffer empty and the
 >         filter implementation can return PDF_ENOUTPUT until it finish
 >         generating data, returning PDF_EEOF.
 > 
 > 
 > Well, it came that it is not needed to modify the algorithm: it
 > already support the desired functionality: you can return PDF_ENOUTPUT
 > when finish_p is true to get more output space and PDF_EEOF when you
 > are finish. 

It's not working, I tested it before sending the previous email to the list.

I did a little change to the RL encoder to show you, it prints 'finish' when
finish_p=TRUE and 'NO finish' otherwise. See:
##
NO finish
finish
NO finish
finish
NO finish
finish
Inserted EOD
###

Basically the error is in the apply function.

File pdf-stm-filter.c: line 176:
##
  really_finish_p = PDF_FALSE;
  ret = PDF_OK;
  while (!pdf_stm_buffer_full_p (filter->out))
    {
      /* Generate output */
###

The 'really_finish_p' is a local variable and hence, lost on each function
return, what you want is that when you set really_finish_p = TRUE it keeps the
value.
The other solution would be that every filter has a boolean state for
this condition but that's not a nice solution. I suggest to fix the
stream filter source.


cheers

-gerel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]