summaryrefslogtreecommitdiff
path: root/libtiff/tif_strip.c
Commit message (Collapse)AuthorAgeFilesLines
* Make defer strile offset/bytecount loading available at runtimeEven Rouault2019-05-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... 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.
* Remove all $Id and $Headers comments with CVS versionsEven Rouault2017-11-301-2/+0
|
* * libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() toEven Rouault2016-12-031-10/+1
| | | | | | | | | | | | | | instanciate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip), instead of a logic based on the total size of data. Which is faulty is the total size of data is not sufficient to fill the whole image, and thus results in reading outside of the StripByCounts/StripOffsets arrays when using TIFFReadScanline(). Reported by Agostino Sarubbo. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2608. * libtiff/tif_strip.c: revert the change in TIFFNumberOfStrips() done for http://bugzilla.maptools.org/show_bug.cgi?id=2587 / CVE-2016-9273 since the above change is a better fix that makes it unnecessary.
* * libtiff/tif_strip.c: make TIFFNumberOfStrips() return the td->td_nstripsEven Rouault2016-11-091-1/+10
| | | | | | | value when it is non-zero, instead of recomputing it. This is needed in TIFF_STRIPCHOP mode where td_nstrips is modified. Fixes a read outsize of array in tiffsplit (or other utilities using TIFFNumberOfStrips()). Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2587
* * libtiff/tif_read.c (TIFFStartTile): Fix Coverity 715973Bob Friesenhahn2015-06-071-3/+9
| | | | "Division or modulo by zero".
* treat illegal ycbcrsubsampling as runtime error, not assertionFrank Warmerdam2012-06-061-4/+6
|
* * configure.ac: Support configuring TIFF_INT64_FORMAT andBob Friesenhahn2011-04-021-2/+2
| | | | | | | | | | | | | | TIFF_UINT64_FORMAT appropriately for MinGW32. * tools/tiffdump.c (ReadDirectory): MinGW32 needs to use WIN32 printf conventions for 64-bit types because it uses the WIN32 CRT. * libtiff/{tif_dumpmode.c,tif_luv.c,tif_lzw.c,tif_print.c, tif_read.c,tif_strip.c,tif_thunder.c}: MinGW32 needs to use WIN32 printf conventions for 64-bit types because it uses the WIN32 CRT. * tools/tiff2pdf.c (t2p_write_pdf_string): Fix printf syntax not understood by WIN32 CRT.
* *** empty log message ***Andrey Kiselev2010-07-011-40/+14
|
* * libtiff/tif_aux.c (_TIFFCheckRealloc): Improve error message soBob Friesenhahn2010-03-101-1/+8
| | | | | that it is clearly a memory allocation error message, and also includes the size of the allocation request.
* Remove an inappropriate assertion that often fails on oddly sized 12bitFrank Warmerdam2009-06-261-7/+6
| | | | jpeg compressed ycbcr images.
* Return an error rather than just asserting on invalid samples perFrank Warmerdam2008-07-291-14/+23
| | | | pixel or subsampling ratios (#1927).
* Use "%I64d" printf() formatter instead of "%lld" with MSVC compiler.Andrey Kiselev2007-07-191-3/+11
|
* BigTIFF upgrade: misc compiler warnings workarounds and few minor bugfixes, ↵Joris Van Damme2007-06-271-14/+1
| | | | restoration of tif_dirwrite.c
* BigTIFF upgrade: misc little things, mostly indentation and unimportant stuffJoris Van Damme2007-06-211-6/+6
|
* BigTIFF upgrade: type restoration - not so messy anymoreJoris Van Damme2007-06-121-32/+32
|
* BigTIFF upgrade in progress - widespread temp mess - does not compile nowJoris Van Damme2007-05-311-4/+8
|
* BigTIFF upgrade in progress - widespread temp mess - does not compile nowJoris Van Damme2007-05-111-1/+3
|
* BigTIFF upgrade in progress - widespread temp mess - does not compile nowJoris Van Damme2007-04-041-38/+117
|
* BigTIFF upgrade in progress - widespread temp mess - does not compile nowJoris Van Damme2007-03-311-1/+1
|
* BigTIFF upgrade in progress - widespread temp mess - does not compile nowJoris Van Damme2007-03-311-15/+18
|
* BigTIFF upgrade in progress - widespread temp mess - does not compile nowJoris Van Damme2007-03-281-158/+104
|
* strip size related bugfix in tif_jpeg encode rawJoris Van Damme2006-03-251-6/+57
|
* bugfix of tif_jpeg decode rawJoris Van Damme2006-03-251-3/+21
|
* Take subsampling in account when calculating TIFFScanlineSize().Andrey Kiselev2006-03-211-9/+41
|
* Removed STRIP_SIZE_DEFAULT macro definition.Andrey Kiselev2006-03-151-5/+1
|
* Use STRIP_SIZE_DEFAULT in _TIFFDefaultStripSize() function.Andrey Kiselev2006-02-271-2/+6
|
* *** empty log message ***Joris Van Damme2005-12-211-6/+6
|
* Zero division problem fixed (Vladimir Nadvornik, Dmitry V. Levin).Andrey Kiselev2004-10-261-2/+7
|
* *** empty log message ***Andrey Kiselev2004-10-021-3/+7
|
* *** empty log message ***Andrey Kiselev2004-10-011-3/+3
|
* Applied patches from Dmitry V. Levin to fix possible integer overflow problems.Andrey Kiselev2004-09-291-5/+24
|
* TIFFScanlineSize() and TIFFRasterScanlineSize() functions report zero in theAndrey Kiselev2004-09-261-7/+25
| | | | | case of integer overflow now. Properly handle this case in TIFFReadDirectory() (patches from Dmitry V. Levin).
* Use TIFFhowmany8() macro where appropriate.Andrey Kiselev2004-09-251-4/+2
|
* Use TIFFhowmany8() macro instead of plain TIFFhowmany() where appropriate.Andrey Kiselev2004-09-221-4/+4
|
* Get rid of BSD data types (u_char, u_short, u_int, u_long).Andrey Kiselev2004-09-141-3/+5
|
* Fixes in error messages, as suggested by Bernd Herd.Andrey Kiselev2004-07-101-3/+3
|
* Never return 0 from the TIFFNumberOfStrips().Andrey Kiselev2004-04-301-3/+2
|
* Added TIFFRawStripSize() function as suggested by Chris Hanson.Andrey Kiselev2003-11-071-1/+21
|
* call TIFFGetField() on YCBCRSUBSAMPLING for tif_jpeg hackFrank Warmerdam2002-07-311-7/+12
|
* Initial revisionMike Welles1999-07-271-0/+192