2007.02.20 21:52 "[Tiff] Patch: Support for reading single-strip files > 2Gb", by Matt Hancher

2007.02.22 12:23 "Re: [Tiff] Patch: Support for reading single-strip files > 2Gb", by Andrey Kiselev

On Tue, Feb 20, 2007 at 01:52:17PM -0800, Matt Hancher wrote:

As noted in bug 890, libtiff does not currently support reading strips larger than 2Gb. In practice this is only a problem because Photoshop likes to save files in single strips.

That bug report suggests that this is difficult to fix because the strip API relies on the value -1 in tsize_t fields. This is actually not a problem. Libtiff is already spoofing the strip size of large single-strip files, so when you're invoking the strip APIs you're working with much smaller numbers. In fact, as far as I can tell you can get libtiff to read these tiff files just fine with two small tweaks that don't affect the external API a bit.

I have attached a patch against the CVS head. The first change involves a downcast to tsize_t in a comparison, presumably to avoid a warning; I just upcast the other argument to uint32 instead. The second change involves a local copy of a uint32 value which was being held locally in a tsize_t by mistake.

Matt,

I have applied your patch along with few more changes in the same direction. It seems that bug #890 now fixed. Thanks!

Best regards,

Andrey

--
Andrey V. Kiselev
ICQ# 26871517