2012.04.19 13:12 "[Tiff] TIFFSeekProc", by Christopher Cameron

2012.04.19 14:15 "Re: [Tiff] TIFFSeekProc", by Christopher Cameron

Agreed.

We just wanted to make sure it wasn't "different" behaviour than lseek() e.g. SEEK_END with a positive offset might have meant "seek backward from end".

Thanks.

Chris Cameron
Software Developer - Multimedia/Camera
ccameron@qnx.com

On 12-04-19 9:48 AM, "Olivier Paquet" <olivier.paquet@gmail.com> wrote:

On Thu, Apr 19, 2012 at 9:12 AM, Christopher Cameron <ccameron@qnx.com> wrote:

An issue came up in the development of a codec that uses libtiff. We are passing the TIFFSeekProc down through some layers to lseek().

typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);

Based on the definition, toff_t is always unsigned. Does this mean we can expect libtiff will never ask for a negative offset, for example with SEEK_END and SEEK_CUR?

That's how it is for now as far as I can see. SEEK_END is only used with 0 and SEEK_CUR with positive offsets. I'd call it unfortunate design but sticking with it does not really limit what libtiff can do.