libtiff/man
Even Rouault 371ad2658c
Make defer strile offset/bytecount loading available at runtime
... and add per-strile offset/bytecount loading capabilities.

Part of this commit makes the behaviour that was previously met when
libtiff was compiled with -DDEFER_STRILE_LOAD available for default builds
when specifying the new 'D' (Deferred) TIFFOpen() flag. In that mode, the [Tile/Strip][ByteCounts/Offsets]
arrays are only loaded when first accessed. This can speed-up the opening
of files stored on the network when just metadata retrieval is needed.
This mode has been used for years by the GDAL library when compiled with
its embeded libtiff copy.

To avoid potential out-of-tree code (typically codecs) that would use
the td_stripbytecount and td_stripoffset array inconditionnaly assuming they
have been loaded, those have been suffixed with _p (for protected). The
use of the new functions mentionned below is then recommended.

Another addition of this commit is the capability of loading only the
values of the offset/bytecount of the strile of interest instead of the
whole array. This is enabled with the new 'O' (Ondemand) flag of TIFFOpen()
(which implies 'D'). That behaviour has also been used by GDAL, which hacked
into the td_stripoffset/td_stripbytecount arrays directly. The new code
added in the _TIFFFetchStrileValue() and _TIFFPartialReadStripArray() internal
functions is mostly a port of what was in GDAL GTiff driver previously.

Related to that, the public TIFFGetStrileOffset[WithErr]() and TIFFGetStrileByteCount[WithErr]()
functions have been added to API. They are of particular interest when
using sparse files (with offset == bytecount == 0) and you want to detect
if a strile is present or not without decompressing the data, or updating
an existing sparse file.
They will also be used to enable a future enhancement where client code can entirely
skip bytecount loading in some situtations

A new test/defer_strile_loading.c test has been added to test the above
capabilities.
2019-05-10 14:46:45 +02:00
..
CMakeLists.txt libtiff 4.0.8 released 2017-05-21 19:10:50 +00:00
fax2ps.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
fax2tiff.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
libtiff.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
Makefile.am * man/Makefile.am: remove thumbnail.1 and rgb2ycbcr.1 from installed man 2016-12-03 15:39:49 +00:00
pal2rgb.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
ppm2tiff.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
raw2tiff.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
rgb2ycbcr.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
thumbnail.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiff2bw.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiff2pdf.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiff2ps.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiff2rgba.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFbuffer.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFClose.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiffcmp.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFcodec.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFcolor.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiffcp.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiffcrop.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFDataWidth.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiffdither.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiffdump.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFError.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFFieldDataType.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFFieldName.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFFieldPassCount.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFFieldReadCount.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFFieldTag.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFFieldWriteCount.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFFlush.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFGetField.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiffgt.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiffinfo.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiffmedian.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFmemory.3tiff Fix some typos 2018-02-24 21:47:52 +01:00
TIFFOpen.3tiff Make defer strile offset/bytecount loading available at runtime 2019-05-10 14:46:45 +02:00
TIFFPrintDirectory.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFquery.3tiff man/TIFFquery.3tiff: remove reference to non-existing TIFFReadStrip() function in TIFFIsByteSwapped() documentation. Patch by Eric Piel. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2763 2017-12-31 15:42:52 +01:00
TIFFReadDirectory.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFReadEncodedStrip.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFReadEncodedTile.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFReadRawStrip.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFReadRawTile.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFReadRGBAImage.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFReadRGBAStrip.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFReadRGBATile.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFReadScanline.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFReadTile.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFRGBAImage.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiffset.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFSetDirectory.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFSetField.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFsize.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
tiffsplit.1 Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFstrip.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFswab.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFtile.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFWarning.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFWriteDirectory.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFWriteEncodedStrip.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFWriteEncodedTile.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFWriteRawStrip.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFWriteRawTile.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFWriteScanline.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00
TIFFWriteTile.3tiff Remove all $Id and $Headers comments with CVS versions 2017-11-30 18:02:46 +01:00