2004.02.09 17:02 "[Tiff] Photoshop 8.0 and libtiff", by Don Ellis

2004.02.09 18:07 "Re: [Tiff] Photoshop 8.0 and libtiff", by Frank Warmerdam

Is it possible to use 'unsigned int' or 'unsigned long' instead? The 32-bit CPU is not going to be able to address more range than an 'unsigned int' will support. All that a 64-bit signed type buys you is support for negative values. Does use of an unsigned type cause problems for the interface?


My first thought was, "hey, we already work fine with 4GB files". But upon a bit of review I realize we use unsigned int for toff_t, but a signed int for tsize_t. The comments in tiffio.h mention that tsize_t is int32 and not uint32 because some functions return -1. So, I think that is why uint32 isn't used now.

I do kind of wonder if the code could be changed somehow to use uint32 for tsize_t but recognise 0xffffffff as end-of-file, instead of -1. There couldn't be something 0xffffffff bytes long in a file of 4GB or less anyways since there is always some other overhead.

I am hesitant to change tsize_t to a 64 bit type without careful review.

Andrey, perhaps you could create a bug report on this issue and when you have some time dig into a solution for tiff files with chunks of larger than 2GB?

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent