2005.04.06 10:22 "[Tiff] What if the given data is not the complete image/file?", by Katrina Maramba
What if the data supplied to me is not the whole file? It is passed to me in chunks/ bands for example, 10 kb at a time.
My first step is to know whether it is the header or the directory or the image. And respectively do the processes to parse each of these.
Obviously, the first data to be given to me is the header. I would keep the information I need like the offset to the directory in my own structure.
Then (maybe) I would keep the remaining data in another buffer so I could go back to it later.
Then I will keep receiving data and keep it in the buffer until I get to the directory. I would then parse the directory and put it in the TIFF struct and also keep the information I would need (like the offsets to the strips) in my own structure.
After that I would go back to the buffer and get the image data and convert it to RGB.
That is my initial plan and I believe its going to work.
However, what I would need from you experts of libtiff is what API's can I use from libtiff in order to get this done.
I realize this is a bit hard since TIFFClientOpen would accept the whole image and parse it for you already. This time, I would have to do everything myself. I would be providing an alternative to TIFFClientOpen. Thats exactly what I need.. an alternative to TiffClientOpen.
Any help would be deeply appreciated. Thanks a lot!