summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tiff/libtiff/tif_open.c')
-rw-r--r--tiff/libtiff/tif_open.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/tiff/libtiff/tif_open.c b/tiff/libtiff/tif_open.c
index a7279e1e..ffe7835f 100644
--- a/tiff/libtiff/tif_open.c
+++ b/tiff/libtiff/tif_open.c
@@ -1,5 +1,3 @@
-/* $Id: tif_open.c,v 1.48 2016-11-20 22:29:47 erouault Exp $ */
-
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
@@ -133,6 +131,7 @@ TIFFClientOpen(
if (!readproc || !writeproc || !seekproc || !closeproc || !sizeproc) {
TIFFErrorExt(clientdata, module,
"One of the client procedures is NULL pointer.");
+ _TIFFfree(tif);
goto bad2;
}
tif->tif_readproc = readproc;
@@ -183,6 +182,8 @@ TIFFClientOpen(
* 'h' read TIFF header only, do not load the first IFD
* '4' ClassicTIFF for creating a file (default)
* '8' BigTIFF for creating a file
+ * 'D' enable use of deferred strip/tile offset/bytecount array loading.
+ * 'O' on-demand loading of values instead of whole array loading (implies D)
*
* The use of the 'l' and 'b' flags is strongly discouraged.
* These flags are provided solely because numerous vendors,
@@ -264,7 +265,22 @@ TIFFClientOpen(
if (m&O_CREAT)
tif->tif_flags |= TIFF_BIGTIFF;
break;
+ case 'D':
+ tif->tif_flags |= TIFF_DEFERSTRILELOAD;
+ break;
+ case 'O':
+ if( m == O_RDONLY )
+ tif->tif_flags |= (TIFF_LAZYSTRILELOAD | TIFF_DEFERSTRILELOAD);
+ break;
}
+
+#ifdef DEFER_STRILE_LOAD
+ /* Compatibility with old DEFER_STRILE_LOAD compilation flag */
+ /* Probably unneeded, since to the best of my knowledge (E. Rouault) */
+ /* GDAL was the only user of this, and will now use the new 'D' flag */
+ tif->tif_flags |= TIFF_DEFERSTRILELOAD;
+#endif
+
/*
* Read in TIFF header.
*/
@@ -715,6 +731,14 @@ TIFFGetUnmapFileProc(TIFF* tif)
return (tif->tif_unmapproc);
}
+void
+TIFFSetJpegMemFunction(TIFF *tif,
+ void *(*fn)(thandle_t))
+{
+ tif->get_jpeg_mem_ptr = fn;
+}
+
+
/* vim: set ts=8 sts=8 sw=8 noet: */
/*
* Local Variables: