44#define FAILED_FII ((uint32_t)-1)
47#define TIFFCvtIEEEFloatToNative(tif, n, fp)
48#define TIFFCvtIEEEDoubleToNative(tif, n, dp)
1185#define INITIAL_THRESHOLD (1024 * 1024)
1186#define THRESHOLD_MULTIPLIER 10
1187#define MAX_THRESHOLD \
1188 (THRESHOLD_MULTIPLIER * THRESHOLD_MULTIPLIER * THRESHOLD_MULTIPLIER * \
1196#if SIZEOF_SIZE_T == 8
1212 while (already_read <
size)
1217#if SIZEOF_SIZE_T == 8
1227 if (new_dest ==
NULL)
1230 "Failed to allocate memory for %s "
1233 "TIFFReadDirEntryArray", (
tmsize_t)1,
1240 already_read += bytes_read;
1251#define MAX_SIZE_TAG_DATA 2147483647U
1262 int original_datasize_clamped;
1268 if ((target_count64 == 0) || (typesize == 0))
1278 original_datasize_clamped =
1305 "Requested memory size for tag %d (0x%x) %" PRIu32
1306 " is greater than filesize %" PRIu64
1307 ". Memory not allocated, tag not read",
1332 if (original_datasize_clamped <= 4 &&
datasize <= 4)
1356 if (original_datasize_clamped <= 8 &&
datasize <= 8)
2788 *
value = (
float *)origdata;
2807 *mb++ = (
float)(*ma++);
2818 *mb++ = (
float)(*ma++);
2832 *mb++ = (
float)(*ma++);
2847 *mb++ = (
float)(*ma++);
2862 *mb++ = (
float)(*ma++);
2877 *mb++ = (
float)(*ma++);
2892 *mb++ = (
float)(*ma++);
2907 *mb++ = (
float)(*ma++);
2931 *mb++ = (
float)maa / (
float)mab;
2956 *mb++ = (
float)maa / (
float)mab;
2968 ma = (
double *)origdata;
3024 *
value = (
double *)origdata;
3043 *mb++ = (
double)(*ma++);
3054 *mb++ = (
double)(*ma++);
3167 *mb++ = (
double)maa / (
double)mab;
3192 *mb++ = (
double)maa / (
double)mab;
3204 ma = (
float *)origdata;
3207 *mb++ = (
double)(*ma++);
3297 if (*na++ != *
value)
3401 assert(
sizeof(
double) == 8);
3421 if (
m.i[0] == 0 ||
m.i[1] == 0)
3433 assert(
sizeof(
double) == 8);
3454 if ((
int32_t)
m.i[0] == 0 ||
m.i[1] == 0)
3469 assert(
sizeof(
double) == 8);
3512 assert(
sizeof(
float) == 4);
3514 assert(
sizeof(float_union) == 4);
3516 *
value = float_union.f;
3524 assert(
sizeof(
double) == 8);
3821 if (
value > 0x7FFFFFFFUL)
3831 if (
value > 0x7FFFFFFF)
3946 "Cannot handle different values per sample for \"%s\"",
3951 "Sanity check on size of \"%s\" value failed",
3969 "Incorrect count for \"%s\"; tag ignored",
3974 "Incompatible type for \"%s\"; tag ignored",
3980 "IO error during reading of \"%s\"; tag ignored",
tagname);
3984 "Incorrect value for \"%s\"; tag ignored",
3989 "Cannot handle different values per sample for "
3990 "\"%s\"; tag ignored",
3996 "Sanity check on size of \"%s\" value failed; tag ignored",
4001 "Out of memory reading of \"%s\"; tag ignored",
4018 switch (photometric)
4067 if (offset <= filesize && bytecount > filesize -
offset)
4077 if (bytecount < scanlinesize * tif->tif_dir.td_imagelength)
4093 "Too large IFD data size");
4102 "Too large IFD data size");
4176 IFDendoffset = tif->
tif_diroff + 2 + dircount * 12 + 4;
4178 IFDendoffset = tif->
tif_diroff + 8 + dircount * 20 + 8;
4189 if (
offset == IFDendoffset)
4194 else if (
offset == IFDendoffset + 1)
4218 if (
offset == IFDendoffset)
4238 static const char module[] =
"TIFFReadDirectory";
4246 int bitspersample_read =
FALSE;
4276 "Failed to read directory at offset %" PRIu64,
4297 for (ma =
dir, mb = 0; mb < dircount; ma++, mb++)
4301 for (na = ma + 1, nb = mb + 1; nb < dircount; na++, nb++)
4313 tif->
tif_flags &= ~TIFF_CHOPPEDUPARRAYS;
4333 "Failed to allocate memory for counting IFD data size at reading");
4401 for (di = 0, dp =
dir; di < dircount; di++, dp++)
4411 "Unknown field with tag %" PRIu16
4412 " (0x%" PRIx16 ") encountered",
4423 "Registering anonymous field with tag %" PRIu16
4424 " (0x%" PRIx16 ") failed",
4494 "Planarconfig tag value assumed incorrect, "
4495 "assuming data is contig instead of chunky");
4511 for (di = 0, dp =
dir; di < dircount; di++, dp++)
4546 fip ? fip->
field_name :
"unknown tagname", 0);
4552 bitspersample_read =
TRUE;
4575 fip ? fip->
field_name :
"unknown tagname", 0);
4605 tif,
module,
"Invalid data type for tag %s",
4634 tif,
module,
"Invalid data type for tag %s",
4660 if (!bitspersample_read)
4665 "Ignoring %s since BitsPerSample tag not found",
4677 "Ignoring %s because BitsPerSample=%" PRIu16 ">24",
4686 countrequired = countpersample;
4687 incrementpersample = 0;
4691 countrequired = 3 * countpersample;
4692 incrementpersample = countpersample;
4705 fip ? fip->
field_name :
"unknown tagname", 1);
4710 value + incrementpersample,
4711 value + 2 * incrementpersample);
4754 err = TIFFReadDirEntryCheckedRationalDirect(
4767 snprintf(szAux,
sizeof(szAux) - 1,
"%d/%d",
4779 "Invalid data type for tag %s. "
4780 "ASCII or RATIONAL expected",
4782 :
"unknown tagname");
4819 "Photometric tag is missing, assuming data is YCbCr");
4827 "Photometric tag value assumed incorrect, "
4828 "assuming data is YCbCr instead of RGB");
4834 "BitsPerSample tag is missing, assuming 8 bits per sample");
4843 "SamplesPerPixel tag is missing, "
4844 "assuming correct SamplesPerPixel value is 3");
4851 "SamplesPerPixel tag is missing, "
4852 "applying correct SamplesPerPixel value of 3");
4890 isTiled(tif) ?
"tiles" :
"strips");
4960 if (color_channels &&
4969 "Sum of Photometric type-related "
4970 "color channels and ExtraSamples doesn't match SamplesPerPixel. "
4971 "Defining non-color channels as ExtraSamples.");
4981 if (!new_sampleinfo)
4984 "Failed to allocate memory for "
4985 "temporary new sampleinfo array "
4986 "(%" PRIu16 " 16 bit elements)",
4991 if (old_extrasamples > 0)
4993 old_extrasamples *
sizeof(
uint16_t));
5044 "TIFF directory is missing required "
5045 "\"StripByteCounts\" field, calculating from imagelength");
5059 "Bogus \"StripByteCounts\" field, ignoring and "
5060 "calculating from imagelength");
5084 "Wrong \"StripByteCounts\" field, ignoring and "
5085 "calculating from imagelength");
5104#ifdef STRIPBYTECOUNTSORTED_UNUSED
5114 tif->
tif_dir.td_stripbytecountsorted = 1;
5120 tif->
tif_dir.td_stripbytecountsorted = 0;
5209 static const char module[] =
"TIFFReadDirectoryCheckOrder";
5214 for (
n = 0, o =
dir;
n < dircount;
n++, o++)
5219 "Invalid TIFF directory; tags are not sorted in "
5234 for (
m =
dir,
n = 0;
n < dircount;
m++,
n++)
5236 if (
m->tdir_tag == tagid)
5281 static const char module[] =
"TIFFReadCustomDirectory";
5294 "Failed to read custom directory at offset %" PRIu64,
5307 for (ma =
dir, mb = 0; mb < dircount; ma++, mb++)
5311 for (na = ma + 1, nb = mb + 1; nb < dircount; na++, nb++)
5341 "Failed to allocate memory for counting IFD data size at reading");
5347 for (di = 0, dp =
dir; di < dircount; di++, dp++)
5367 "Registering anonymous field with tag %" PRIu16
5368 " (0x%" PRIx16 ") failed",
5403 "Wrong data type %" PRIu16
5404 " for \"%s\"; tag ignored",
5478 static const char module[] =
"EstimateStripByteCounts";
5490 if (allocsize > 100 * 1024 * 1024)
5495 if (allocsize > filesize)
5499 "Requested memory size for StripByteCounts of %" PRIu64
5500 " is greater than filesize %" PRIu64 ". Memory not allocated",
5501 allocsize, filesize);
5522 for (dp =
dir,
n = dircount;
n > 0;
n--, dp++)
5531 "Cannot determine size of unknown tag type %" PRIu16,
5554 if (filesize <
space)
5561 for (strip = 0; strip < td->
td_nstrips; strip++)
5593 for (strip = 0; strip < td->
td_nstrips; strip++)
5600 for (strip = 0; strip < td->
td_nstrips; strip++)
5602 if (rowbytes > 0 && rowsperstrip >
UINT64_MAX / rowbytes)
5615 static const char module[] =
"MissingRequired";
5618 "TIFF directory is missing required \"%s\" field",
tagname);
5636 return offsetAndDirNumber1->
offset == offsetAndDirNumber2->
offset;
5677 "Not enough memory");
5691 "Not enough memory");
5702 entry.offset = diroff;
5703 entry.dirNumber = dirn;
5717 "TIFF directory %d has IFD looping to directory %u "
5719 (
int)dirn - 1, foundEntry->
dirNumber, diroff,
5731 if (foundEntry->
offset != diroff)
5757 if (entryPtr ==
NULL)
5768 tif,
"_TIFFCheckDirNumberAndOffset",
5769 "Insertion in tif_map_dir_offset_to_number failed");
5775 tif,
"_TIFFCheckDirNumberAndOffset",
5776 "Insertion in tif_map_dir_number_to_offset failed");
5788 "Cannot handle more than %u TIFF directories",
5795 if (entryPtr ==
NULL)
5798 "malloc(sizeof(TIFFOffsetAndDirNumber)) failed");
5808 "Insertion in tif_map_dir_offset_to_number failed");
5814 "Insertion in tif_map_dir_number_to_offset failed");
5840 entry.offset = diroff;
5841 entry.dirNumber = 0;
5880 entry.dirNumber = dirn;
5887 *diroff = foundEntry->
offset;
5906 entryOld.
offset = diroff;
5915 if (foundEntryOldOff)
5923 if (foundEntryOldDir)
5934 TIFFErrorExtR(tif,
"_TIFFRemoveEntryFromDirectoryListByOffset",
5935 "Unexpectedly tif_map_dir_number_to_offset is "
5936 "missing but tif_map_dir_offset_to_number exists.");
5953 "incorrect count for field \"%s\" (%" PRIu64
5954 ", expecting %" PRIu32 "); tag ignored",
5959 else if ((
uint64_t)count < dir->tdir_count)
5963 "incorrect count for field \"%s\" (%" PRIu64
5964 ", expecting %" PRIu32 "); tag trimmed",
5981 static const char module[] =
"TIFFFetchDirectory";
6001 "%s: Seek error accessing TIFF directory",
6010 "%s: Can not read TIFF directory count",
6016 if (dircount16 > 4096)
6019 "Sanity check on directory count failed, this is "
6020 "probably not a valid IFD offset");
6031 "%s: Can not read TIFF directory count",
6037 if (dircount64 > 4096)
6040 "Sanity check on directory count failed, this is "
6041 "probably not a valid IFD offset");
6048 "to read TIFF directory");
6049 if (origdir ==
NULL)
6071 *nextdiroff = nextdiroff32;
6118 if (dircount16 > 4096)
6121 "Sanity check on directory count failed, this is "
6122 "probably not a valid IFD offset");
6144 if (dircount64 > 4096)
6147 "Sanity check on directory count failed, this is "
6148 "probably not a valid IFD offset");
6154 if (dircount16 == 0)
6157 "Sanity check on directory count failed, zero tag "
6158 "directories not supported");
6165 if (allocsize > filesize)
6169 "Requested memory size for TIFF directory of %" PRIu64
6170 " is greater than filesize %" PRIu64
6171 ". Memory not allocated, TIFF directory not read",
6172 allocsize, filesize);
6176 "to read TIFF directory");
6177 if (origdir ==
NULL)
6179 m = off + dircount16 * dirsize;
6180 if ((
m < off) || (
m < (
tmsize_t)(dircount16 * dirsize)) ||
6193 off += dircount16 * dirsize;
6206 *nextdiroff = nextdiroff32;
6225 tif, dircount16,
sizeof(
TIFFDirEntry),
"to read TIFF directory");
6233 for (
n = 0;
n < dircount16;
n++)
6275 static const char module[] =
"TIFFFetchNormalTag";
6299 tif,
"TIFFFetchNormalTag",
6300 "Defined set_get_field_type of custom tag %u (%s) is "
6301 "TIFF_SETGET_UNDEFINED and thus tag is not read from file",
6345 "ASCII value for tag \"%s\" contains null byte in "
6346 "value; value incorrectly truncated during reading due "
6347 "to implementation limitations",
6352 "ASCII value for tag \"%s\" does not end "
6353 "in null byte. Forcing it to be null",
6544 "incorrect count for field \"%s\", expected 2, "
6569 "incorrect count for field \"%s\", expected "
6604 "incorrect count for field \"%s\", expected "
6639 "incorrect count for field \"%s\", expected "
6674 "incorrect count for field \"%s\", expected "
6709 "incorrect count for field \"%s\", expected "
6744 "incorrect count for field \"%s\", expected "
6779 "incorrect count for field \"%s\", expected "
6814 "incorrect count for field \"%s\", expected "
6849 "incorrect count for field \"%s\", expected "
6886 "incorrect count for field \"%s\", expected "
6936 "ASCII value for ASCII array tag "
6937 "\"%s\" does not end in null "
6938 "byte. Forcing it to be null",
7308 "ASCII value for ASCII array tag \"%s\" does not end "
7309 "in null byte. Forcing it to be null",
7646 static const char module[] =
"TIFFFetchStripThing";
7654 fip ? fip->
field_name :
"unknown tagname", 0);
7661 const char *pszMax =
getenv(
"LIBTIFF_STRILE_ARRAY_MAX_RESIZE_COUNT");
7667 (nstrips <= max_nstrips));
7669 if (nstrips > max_nstrips)
7676 if (allocsize > 100 * 1024 * 1024)
7682 if (allocsize > filesize)
7686 "Requested memory size for StripArray of %" PRIu64
7687 " is greater than filesize %" PRIu64
7688 ". Memory not allocated",
7689 allocsize, filesize);
7695 tif, nstrips,
sizeof(
uint64_t),
"for strip array");
7696 if (resizeddata == 0)
7701 if (
dir->tdir_count)
7718 static const char module[] =
"TIFFFetchSubjectDistance";
7722 assert(
sizeof(
double) == 8);
7725 if (
dir->tdir_count != 1)
7741 m.l =
dir->tdir_offset.toff_long8;
7752 else if (
m.i[0] == 0xFFFFFFFF ||
m.i[1] == 0)
7786 if (last_offset >
UINT64_MAX - last_bytecount ||
7787 last_offset + last_bytecount <
offset)
7791 bytecount = last_offset + last_bytecount -
offset;
7798 if (allocsize > 100 * 1024 * 1024)
7801 if (allocsize > filesize)
7804 "Requested memory size for StripByteCount and "
7806 " is greater than filesize %" PRIu64
7807 ". Memory not allocated",
7808 allocsize, filesize);
7815 "for chopped \"StripByteCounts\" array");
7817 tif, nstrips,
sizeof(
uint64_t),
"for chopped \"StripOffsets\" array");
7818 if (newcounts ==
NULL || newoffsets ==
NULL)
7824 if (newcounts !=
NULL)
7826 if (newoffsets !=
NULL)
7835 for (
i = 0;
i < nstrips;
i++)
7837 if (stripbytes > bytecount)
7838 stripbytes = bytecount;
7839 newcounts[
i] = stripbytes;
7840 newoffsets[
i] = stripbytes ?
offset : 0;
7842 bytecount -= stripbytes;
7855#ifdef STRIPBYTECOUNTSORTED_UNUSED
7856 td->td_stripbytecountsorted = 1;
7897 stripbytes = rowblockbytes;
7898 rowsperstrip = rowblock;
7900 else if (rowblockbytes > 0)
7904 rowsperstrip = rowblocksperstrip * rowblock;
7905 stripbytes = rowblocksperstrip * rowblockbytes;
7955 assert(stripsize > 0x7FFFFFFFUL);
7968 if (rowblockbytes == 0 || rowblockbytes > 0x7FFFFFFFUL)
8002 rowblocksperstrip = (
uint32_t)(512 * 1024 * 1024 / rowblockbytes);
8003 if (rowblocksperstrip == 0)
8004 rowblocksperstrip = 1;
8005 rowsperstrip = rowblocksperstrip * rowblock;
8006 stripbytes = rowblocksperstrip * rowblockbytes;
8007 assert(stripbytes <= 0x7FFFFFFFUL);
8009 if (rowsperstrip == 0)
8023 if (last_offset > filesize || last_bytecount > filesize - last_offset)
8045 static const char module[] =
"_TIFFPartialReadStripArray";
8046#define IO_CACHE_PAGE_SIZE 4096
8086 "Invalid type for [Strip|Tile][Offset/ByteCount] tag");
8087 panVals[strile] = 0;
8090 sizeofvalint = (
int)(sizeofval);
8111 panVals[strile] = 0;
8114 nOffset = nBaseOffset + sizeofval * strile;
8118 if (nOffset + sizeofval > nOffsetEndPage)
8120#undef IO_CACHE_PAGE_SIZE
8122 nLastStripOffset = nBaseOffset + arraySize * sizeofval;
8123 if (nLastStripOffset < nOffsetEndPage)
8124 nOffsetEndPage = nLastStripOffset;
8125 if (nOffsetStartPage >= nOffsetEndPage)
8129 panVals[strile] = 0;
8132 if (!
SeekOK(tif, nOffsetStartPage))
8134 panVals[strile] = 0;
8138 nToRead = (
tmsize_t)(nOffsetEndPage - nOffsetStartPage);
8140 if (nRead < nToRead)
8143 "Cannot read offset/size for strile around ~%d", strile);
8146 iStartBefore = -(
int)((nOffset - nOffsetStartPage) / sizeofval);
8147 if (strile + iStartBefore < 0)
8148 iStartBefore = -strile;
8149 for (
i = iStartBefore;
8159 buffer + (nOffset - nOffsetStartPage) +
i * sizeofvalint,
8163 panVals[strile +
i] =
val;
8169 buffer + (nOffset - nOffsetStartPage) +
i * sizeofvalint,
8173 panVals[strile +
i] =
val;
8179 buffer + (nOffset - nOffsetStartPage) +
i * sizeofvalint,
8183 panVals[strile +
i] =
val;
8190 buffer + (nOffset - nOffsetStartPage) +
i * sizeofvalint,
8203 static const char module[] =
"_TIFFFetchStrileValue";
8205 if (strile >=
dirent->tdir_count)
8218 if (strile > 1000000)
8224 if (strile > filesize /
sizeof(
uint32_t))
8238#define TIFF_MAX(a, b) (((a) > (b)) ? (a) : (b))
8239#define TIFF_MIN(a, b) (((a) < (b)) ? (a) : (b))
8240 nStripArrayAllocNew =
TIFF_MAX(strile + 1, 1024U * 512U);
8241 if (nStripArrayAllocNew < 0xFFFFFFFFU / 2)
8242 nStripArrayAllocNew *= 2;
8245 assert(strile < nStripArrayAllocNew);
8247 nArraySize = (
size_t)(nArraySize64);
8248#if SIZEOF_SIZE_T == 4
8249 if (nArraySize != nArraySize64)
8252 "Cannot allocate strip offset and bytecount arrays");
8264 if (offsetArray && bytecountArray)
8280 "Cannot allocate strip offset and bytecount arrays");
8291 if (~((*parray)[strile]) == 0)
8295 (*parray)[strile] = 0;
8344 return (*parray)[strile];
8386 int return_value = 1;
8418 if (loadStripByteCount &&
8428#ifdef STRIPBYTECOUNTSORTED_UNUSED
8433 tif->
tif_dir.td_stripbytecountsorted = 1;
8439 tif->
tif_dir.td_stripbytecountsorted = 0;
8446 return return_value;
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
char *CDECL getenv(const char *name)
_ACRTIMP void __cdecl qsort(void *, size_t, size_t, int(__cdecl *)(const void *, const void *))
_ACRTIMP int __cdecl atoi(const char *)
_ACRTIMP size_t __cdecl strlen(const char *)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
static float(__cdecl *square_half_float)(float x
union TIFFDirEntry::@3701 tdir_offset
uint32_t td_dirdatasize_Noffsets
uint64_t td_dirdatasize_read
uint16_t td_bitspersample
TIFFDirEntry td_stripoffset_entry
uint16_t td_maxsamplevalue
uint32_t td_stripsperimage
uint64_t * td_stripbytecount_p
unsigned char td_iswrittentofile
uint64_t * td_stripoffset_p
uint16_t td_ycbcrsubsampling[2]
uint16_t td_samplesperpixel
TIFFDirEntry td_stripbytecount_entry
uint32_t td_stripoffsetbyteallocsize
TIFFEntryOffsetAndLength * td_dirdatasize_offsets
unsigned char field_passcount
TIFFSetGetFieldType set_get_field_type
int tif_warn_about_unknown_tags
int tif_setdirectory_force_absolute
tmsize_t tif_scanlinesize
TIFFBoolMethod tif_fixuptags
TIFFHashSet * tif_map_dir_number_to_offset
TIFFHashSet * tif_map_dir_offset_to_number
void * _TIFFCheckMalloc(TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what)
#define TIFF_MAX_DIR_COUNT
#define STRIP_SIZE_DEFAULT
#define TIFF_SSIZE_FORMAT
tdir_t TIFFNumberOfDirectories(TIFF *tif)
void TIFFFreeDirectory(TIFF *tif)
int TIFFSetField(TIFF *tif, uint32_t tag,...)
int TIFFDefaultDirectory(TIFF *tif)
void _TIFFsetShortArrayExt(TIFF *tif, uint16_t **wpp, const uint16_t *wp, uint32_t n)
#define FIELD_STRIPOFFSETS
#define FIELD_IMAGEDIMENSIONS
#define TIFFFieldSet(tif, field)
#define FIELD_MAXSAMPLEVALUE
#define FIELD_TILEDIMENSIONS
#define FIELD_ROWSPERSTRIP
#define FIELD_STRIPBYTECOUNTS
#define FIELD_BITSPERSAMPLE
@ TIFF_SETGET_UINT16_PAIR
#define TIFFSetFieldBit(tif, field)
#define FIELD_SAMPLESPERPIXEL
#define FIELD_PHOTOMETRIC
int TIFFFieldIsAnonymous(const TIFFField *fip)
const TIFFField * TIFFFieldWithTag(TIFF *tif, uint32_t tag)
int _TIFFMergeFields(TIFF *tif, const TIFFField info[], uint32_t n)
int TIFFDataWidth(TIFFDataType type)
TIFFField * _TIFFCreateAnonField(TIFF *tif, uint32_t tag, TIFFDataType field_type)
void _TIFFSetupFields(TIFF *tif, const TIFFFieldArray *fieldarray)
const TIFFFieldArray * _TIFFGetGpsFields(void)
int _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
const TIFFFieldArray * _TIFFGetExifFields(void)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedLong8(TIFF *tif, TIFFDirEntry *direntry, uint64_t *value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSrational(TIFF *tif, TIFFDirEntry *direntry, double *value)
static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong8Array(TIFF *tif, TIFFDirEntry *direntry, int64_t **value)
int _TIFFRemoveEntryFromDirectoryListByOffset(TIFF *tif, uint64_t diroff)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong(uint32_t value)
static void MissingRequired(TIFF *, const char *)
int _TIFFCheckDirNumberAndOffset(TIFF *tif, tdir_t dirn, uint64_t diroff)
static enum TIFFReadDirEntryErr TIFFReadDirEntryShort(TIFF *tif, TIFFDirEntry *direntry, uint16_t *value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Sbyte(int8_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong(uint32_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Slong8(int64_t value)
#define INITIAL_THRESHOLD
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong(uint32_t value)
static void TIFFReadDirEntryCheckedSlong(TIFF *tif, TIFFDirEntry *direntry, int32_t *value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSshort(int16_t value)
static void TIFFReadDirectoryFindFieldInfo(TIFF *tif, uint16_t tagid, uint32_t *fii)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSbyte(int8_t value)
static int CheckDirCount(TIFF *, TIFFDirEntry *, uint32_t)
static enum TIFFReadDirEntryErr TIFFReadDirEntryArray(TIFF *tif, TIFFDirEntry *direntry, uint32_t *count, uint32_t desttypesize, void **value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSshort(int16_t value)
static void CalcFinalIFDdatasizeReading(TIFF *tif, uint16_t dircount)
static void TryChopUpUncompressedBigTiff(TIFF *)
static void TIFFReadDirEntryCheckedShort(TIFF *tif, TIFFDirEntry *direntry, uint16_t *value)
uint64_t TIFFGetStrileOffset(TIFF *tif, uint32_t strile)
static void TIFFReadDirectoryCheckOrder(TIFF *tif, TIFFDirEntry *dir, uint16_t dircount)
static uint64_t TIFFReadUInt64(const uint8_t *value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8ArrayWithLimit(TIFF *tif, TIFFDirEntry *direntry, uint64_t **value, uint64_t maxcount)
static int ByteCountLooksBad(TIFF *tif)
static enum TIFFReadDirEntryErr TIFFReadDirEntryDoubleArray(TIFF *tif, TIFFDirEntry *direntry, double **value)
static void TIFFReadDirEntryOutputErr(TIFF *tif, enum TIFFReadDirEntryErr err, const char *module, const char *tagname, int recover)
static enum TIFFReadDirEntryErr TIFFReadDirEntryArrayWithLimit(TIFF *tif, TIFFDirEntry *direntry, uint32_t *count, uint32_t desttypesize, void **value, uint64_t maxcount)
int _TIFFGetOffsetFromDirNumber(TIFF *tif, tdir_t dirn, uint64_t *diroff)
static TIFFDirEntry * TIFFReadDirectoryFindEntry(TIFF *tif, TIFFDirEntry *dir, uint16_t dircount, uint16_t tagid)
static enum TIFFReadDirEntryErr TIFFReadDirEntryFloat(TIFF *tif, TIFFDirEntry *direntry, float *value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteShort(uint16_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteShort(uint16_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlongSlong8(int64_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyte(TIFF *tif, TIFFDirEntry *direntry, int8_t *value)
static void ChopUpSingleUncompressedStrip(TIFF *)
static bool equalFuncNumberToOffset(const void *elt1, const void *elt2)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong(uint32_t value)
static int _TIFFFetchStrileValue(TIFF *tif, uint32_t strile, TIFFDirEntry *dirent, uint64_t **parray)
int _TIFFGetDirNumberFromOffset(TIFF *tif, uint64_t diroff, tdir_t *dirn)
static enum TIFFReadDirEntryErr TIFFReadDirEntryByte(TIFF *tif, TIFFDirEntry *direntry, uint8_t *value)
@ TIFFReadDirEntryErrPsdif
@ TIFFReadDirEntryErrRange
@ TIFFReadDirEntryErrSizesan
@ TIFFReadDirEntryErrAlloc
@ TIFFReadDirEntryErrType
@ TIFFReadDirEntryErrCount
static void TIFFReadDirEntryCheckedByte(TIFF *tif, TIFFDirEntry *direntry, uint8_t *value)
int TIFFReadCustomDirectory(TIFF *tif, toff_t diroff, const TIFFFieldArray *infoarray)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong(int32_t value)
static bool EvaluateIFDdatasizeReading(TIFF *tif, TIFFDirEntry *dp)
static enum TIFFReadDirEntryErr TIFFReadDirEntryData(TIFF *tif, uint64_t offset, tmsize_t size, void *dest)
static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong8(TIFF *tif, TIFFDirEntry *direntry, int64_t *value)
static uint64_t _TIFFGetStrileOffsetOrByteCountValue(TIFF *tif, uint32_t strile, TIFFDirEntry *dirent, uint64_t **parray, int *pbErr)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong8(uint64_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong(int32_t value)
int _TIFFFillStriles(TIFF *tif)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSbyte(int8_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlongLong(uint32_t value)
static int cmpTIFFEntryOffsetAndLength(const void *a, const void *b)
static int _TIFFPartialReadStripArray(TIFF *tif, TIFFDirEntry *dirent, int strile, uint64_t *panVals)
#define IO_CACHE_PAGE_SIZE
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSbyte(int8_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryDataAndRealloc(TIFF *tif, uint64_t offset, tmsize_t size, void **pdest)
static uint16_t TIFFFetchDirectory(TIFF *tif, uint64_t diroff, TIFFDirEntry **pdir, uint64_t *nextdiroff)
static enum TIFFReadDirEntryErr TIFFReadDirEntryDouble(TIFF *tif, TIFFDirEntry *direntry, double *value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8Array(TIFF *tif, TIFFDirEntry *direntry, uint64_t **value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong(int32_t value)
void TIFFCvtIEEEFloatToNative(TIFF *, uint32_t, float *)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSshort(int16_t value)
static void TIFFReadDirEntryCheckedFloat(TIFF *tif, TIFFDirEntry *direntry, float *value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryLong(TIFF *tif, TIFFDirEntry *direntry, uint32_t *value)
#define THRESHOLD_MULTIPLIER
static unsigned long hashFuncOffsetToNumber(const void *elt)
static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF *tif, TIFFDirEntry *direntry, int8_t **value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF *tif, TIFFDirEntry *direntry, uint16_t **value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong(int32_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong8(uint64_t value)
static void TIFFReadDirEntryCheckedSshort(TIFF *tif, TIFFDirEntry *direntry, int16_t *value)
static bool equalFuncOffsetToNumber(const void *elt1, const void *elt2)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong(int32_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlongLong8(uint64_t value)
static unsigned long hashFuncNumberToOffset(const void *elt)
static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF *tif, TIFFDirEntry *direntry, int16_t **value)
static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF *tif, TIFFDirEntry *direntry, int32_t **value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF *tif, TIFFDirEntry *direntry, float **value)
static void TIFFReadDirEntryCheckedSbyte(TIFF *tif, TIFFDirEntry *direntry, int8_t *value)
int TIFFReadGPSDirectory(TIFF *tif, toff_t diroff)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong8(uint64_t value)
uint64_t TIFFGetStrileOffsetWithErr(TIFF *tif, uint32_t strile, int *pbErr)
static void TIFFReadDirEntryCheckedLong(TIFF *tif, TIFFDirEntry *direntry, uint32_t *value)
static int EstimateStripByteCounts(TIFF *tif, TIFFDirEntry *dir, uint16_t dircount)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteByte(uint8_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong8(int64_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong8(int64_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongLong8(uint64_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSlong8(TIFF *tif, TIFFDirEntry *direntry, int64_t *value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Slong(int32_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8(TIFF *tif, TIFFDirEntry *direntry, uint64_t *value)
static int TIFFFetchSubjectDistance(TIFF *, TIFFDirEntry *)
static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong(TIFF *tif, TIFFDirEntry *direntry, int32_t *value)
static int _TIFFGetMaxColorChannels(uint16_t photometric)
static TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW uint64_t _TIFFUnsanitizedAddUInt64AndInt(uint64_t a, int b)
#define MAX_SIZE_TAG_DATA
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong8(uint64_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSshort(int16_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8(TIFF *tif, TIFFDirEntry *direntry, uint64_t *value)
int TIFFReadEXIFDirectory(TIFF *tif, toff_t diroff)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedDouble(TIFF *tif, TIFFDirEntry *direntry, double *value)
static int _TIFFFillStrilesInternal(TIFF *tif, int loadStripByteCount)
int TIFFReadDirectory(TIFF *tif)
static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8Array(TIFF *tif, TIFFDirEntry *direntry, uint64_t **value)
static void allocChoppedUpStripArrays(TIFF *tif, uint32_t nstrips, uint64_t stripbytes, uint32_t rowsperstrip)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong8(int64_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortShort(uint16_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryLongArray(TIFF *tif, TIFFDirEntry *direntry, uint32_t **value)
uint64_t TIFFGetStrileByteCount(TIFF *tif, uint32_t strile)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedRational(TIFF *tif, TIFFDirEntry *direntry, double *value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong8(int64_t value)
union _UInt64Aligned_t UInt64Aligned_t
static enum TIFFReadDirEntryErr TIFFReadDirEntrySshort(TIFF *tif, TIFFDirEntry *direntry, int16_t *value)
static int TIFFFetchStripThing(TIFF *tif, TIFFDirEntry *dir, uint32_t nstrips, uint64_t **lpp)
uint64_t TIFFGetStrileByteCountWithErr(TIFF *tif, uint32_t strile, int *pbErr)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong8(int64_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF *tif, TIFFDirEntry *direntry, uint8_t **value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleShort(TIFF *tif, TIFFDirEntry *direntry, uint16_t *value)
void TIFFCvtIEEEDoubleToNative(TIFF *, uint32_t, double *)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Sshort(int16_t value)
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlong8Long8(uint64_t value)
static int TIFFFetchNormalTag(TIFF *, TIFFDirEntry *, int recover)
void TIFFErrorExtR(TIFF *tif, const char *module, const char *fmt,...)
void * TIFFHashSetLookup(TIFFHashSet *set, const void *elt)
bool TIFFHashSetInsert(TIFFHashSet *set, void *elt)
bool TIFFHashSetRemove(TIFFHashSet *set, const void *elt)
int TIFFHashSetSize(const TIFFHashSet *set)
TIFFHashSet * TIFFHashSetNew(TIFFHashSetHashFunc fnHashFunc, TIFFHashSetEqualFunc fnEqualFunc, TIFFHashSetFreeEltFunc fnFreeEltFunc)
void _TIFFfreeExt(TIFF *tif, void *p)
void * _TIFFreallocExt(TIFF *tif, void *p, tmsize_t s)
void * _TIFFmallocExt(TIFF *tif, tmsize_t s)
void * _TIFFcallocExt(TIFF *tif, tmsize_t nmemb, tmsize_t siz)
tmsize_t TIFFStripSize(TIFF *tif)
tmsize_t TIFFScanlineSize(TIFF *tif)
uint64_t TIFFScanlineSize64(TIFF *tif)
uint32_t TIFFNumberOfStrips(TIFF *tif)
uint64_t TIFFVStripSize64(TIFF *tif, uint32_t nrows)
uint64_t TIFFStripSize64(TIFF *tif)
void TIFFSwabArrayOfLong(register uint32_t *lp, tmsize_t n)
void TIFFSwabLong8(uint64_t *lp)
void TIFFSwabShort(uint16_t *wp)
void TIFFSwabArrayOfLong8(register uint64_t *lp, tmsize_t n)
void TIFFSwabLong(uint32_t *lp)
void TIFFSwabArrayOfShort(register uint16_t *wp, tmsize_t n)
tmsize_t TIFFTileSize(TIFF *tif)
uint64_t TIFFVTileSize64(TIFF *tif, uint32_t nrows)
uint64_t TIFFTileSize64(TIFF *tif)
uint32_t TIFFNumberOfTiles(TIFF *tif)
void _TIFFmemset(void *p, int v, tmsize_t c)
void _TIFFmemcpy(void *d, const void *s, tmsize_t c)
void TIFFWarningExtR(TIFF *tif, const char *module, const char *fmt,...)
int TIFFSetupStrips(TIFF *tif)
#define TIFFTAG_BITSPERSAMPLE
#define PLANARCONFIG_SEPARATE
#define OFILETYPE_REDUCEDIMAGE
#define COMPRESSION_OJPEG
#define TIFFTAG_SAMPLESPERPIXEL
#define PHOTOMETRIC_ITULAB
#define PHOTOMETRIC_CIELAB
#define TIFFTAG_IMAGEDEPTH
#define TIFFTAG_PHOTOMETRIC
#define EXIFTAG_SUBJECTDISTANCE
#define TIFFTAG_TILELENGTH
#define TIFFTAG_OSUBFILETYPE
#define TIFFTAG_MAXSAMPLEVALUE
#define TIFFTAG_TILEDEPTH
#define PHOTOMETRIC_PALETTE
#define TIFFTAG_EXTRASAMPLES
#define TIFFTAG_IMAGEWIDTH
#define PHOTOMETRIC_SEPARATED
#define FILETYPE_REDUCEDIMAGE
#define PHOTOMETRIC_LOGLUV
#define TIFFTAG_MINSAMPLEVALUE
#define PHOTOMETRIC_ICCLAB
#define PHOTOMETRIC_YCBCR
#define TIFFTAG_TRANSFERFUNCTION
#define TIFFTAG_TILEBYTECOUNTS
#define PHOTOMETRIC_MINISWHITE
#define TIFFTAG_STRIPBYTECOUNTS
#define TIFFTAG_SMINSAMPLEVALUE
#define TIFFTAG_TILEOFFSETS
#define TIFFTAG_ROWSPERSTRIP
#define TIFFTAG_SMAXSAMPLEVALUE
#define TIFFTAG_SAMPLEFORMAT
#define TIFFTAG_TILEWIDTH
#define TIFFTAG_IMAGELENGTH
#define TIFFTAG_COMPRESSION
#define PHOTOMETRIC_MINISBLACK
#define TIFFTAG_PLANARCONFIG
#define TIFFTAG_STRIPOFFSETS
#define TIFFTAG_SUBFILETYPE
#define TIFFTAG_EP_BATTERYLEVEL
#define TIFFTAG_RICHTIFFIPTC
#define PLANARCONFIG_CONTIG
#define TIFF_NON_EXISTENT_DIR_NUMBER
#define TIFFReadFile(tif, buf, size)
#define TIFF_CHOPPEDUPARRAYS
#define TIFF_LAZYSTRILELOAD
#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
#define ReadOK(tif, buf, size)
#define TIFF_DEFERSTRILELOAD
#define TIFFGetFileSize(tif)
#define TIFFSeekFile(tif, off, whence)
#define TIFFhowmany_32(x, y)