pdf-devel
[Top][All Lists]
Advanced

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

Re: [pdf-devel] CCITT Filters


From: Vivek Paradkar
Subject: Re: [pdf-devel] CCITT Filters
Date: Sun, 7 Dec 2008 23:03:03 -0500

Hi,

I have checked few utilities which are using libTiff decoding images compressed by CCITT stnd are all using it's internal structures. I have attached fax2tiff.c file with the mail, which comes with libTiff library source.

In fax2tiff a fax file is being read and converted into a TIFF image. This is a scenario similar to what we have to do for decoding the stream read from a PDF file.
In copyFaxFile function, directly internal structures are accessed for decoding.

The problem in case of decoding as mentioned in my previous mail is that all  it's internal structure won't get initialised properly since we are not working with proper TIFF Image  format.
libTiff is designed to decode a TIFF image, if we want to decode non TIFF source then we will have to access it's internal structures.

Please advice. I am stuck here and not able to proceed.

I even tried to find some other library but all implementations are mostly using libTiff only.

Thanks and regards,

Vivek

On Sun, Dec 7, 2008 at 6:32 AM, Vivek Paradkar <address@hidden> wrote:
Hi,

TIFFClientOpen can be used in case of encoding data.
Panda is using TIFFClientOpen for encoding TIFF image.

But for decoding TIFFClientOpen calls TIFFReadDirectory for initialising internal TIFFDirectory structure. The structure data is used in TIFFReadEncodedStrip function
which decodes the input data into user buffer.

I can call TIFFClientOpen initially with write mode so that TIFFReadDirectory will not be called and change the mode to read for decoding later. Not all fields of structure TIFFDirectory can be updated through TIFFSetField function like td_nstrips etc.
which are used in TIFFReadEncodedStrip.
I checked code for fax2tiff utility which reads fax data and converts it into TIFF image, but in that they are directly accessing internal structures and directly calling decode function, instead of calling TIFFReadEncodedStrip.

Any suggestions.

Thanks and Rgrds,

Vivek Paradkar

On Fri, Dec 5, 2008 at 11:55 PM, Vivek Paradkar <address@hidden> wrote:
Hi Brad,


   TIFFClientOpen is probably what you are looking for. That will allow you to
   use your own file-like routines instead of operating on an actual file.

Yes TIFFClientOpen can be used.
Thanks for suggestion

Vivek



On Fri, Dec 5, 2008 at 6:25 PM, Brad Hards <address@hidden> wrote:
On Friday 05 December 2008 04:26:40 pm address@hidden wrote:
> Current implementation of libTiff only supports encoding/decoding of TIFF  
> Images
> read from a file.
>
> I will look into how panda is using libtiff library and will find out other
>   alternative of using libTiff
> for applying filter on arbitrary array without integrating if possible.

TIFFClientOpen is probably what you are looking for. That will allow you to
use your own file-like routines instead of operating on an actual file.

Brad







Attachment: fax2tiff.c
Description: Text Data


reply via email to

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