38#define DATATYPE_VOID 0
40#define DATATYPE_UINT 2
41#define DATATYPE_IEEEFP 3
128 ((
double *)*vpp)[nmemb] =
value;
138#define EXTRASAMPLE_COREL_UNASSALPHA 999
143 static const char module[] =
"setExtraSamples";
149 if (*
v > 0 && va ==
NULL)
151 for (
i = 0;
i < *
v;
i++)
173 "ExtraSamples tag value is changing, "
174 "but TransferFunction was read with a different value. "
185#undef EXTRASAMPLE_COREL_UNASSALPHA
198 const char *ep =
s + slen;
202 for (;
cp < ep && *
cp !=
'\0';
cp++)
214 "%s: Invalid InkNames value; no null at given buffer end "
222 static const char module[] =
"_TIFFVSetField";
244 switch (standard_tag)
331 "SamplesPerPixel tag value is changing, "
332 "but SMinSampleValue tag was read with a "
333 "different value. Canceling it");
341 "SamplesPerPixel tag value is changing, "
342 "but SMaxSampleValue tag was read with a "
343 "different value. Canceling it");
356 "SamplesPerPixel tag value is changing, "
357 "but TransferFunction was read with a "
358 "different value. Canceling it");
405 if (dblval != dblval || dblval < 0)
411 if (dblval != dblval || dblval < 0)
470 "Nonstandard tile width %" PRIu32 ", convert file", v32);
483 "Nonstandard tile length %" PRIu32 ", convert file", v32);
561 for (
i = 0;
i <
v;
i++)
578 status = ninksinstring > 0;
579 if (ninksinstring > 0)
590 "Warning %s; Tag %s:\n Value %" PRIu16
591 " of NumberOfInks is different from the number of "
593 ".\n -> NumberOfInks value adapted to %" PRIu16 "",
595 ninksinstring, ninksinstring);
609 "Warning %s; Tag %s:\n Value %" PRIu16
610 " of NumberOfInks is different from the "
611 "SamplesPerPixel value %" PRIu16 "",
630 "Error %s; Tag %s:\n It is not possible to set the "
632 " for NumberOfInks\n which is different from the "
633 "number of inks in the InkNames tag (%" PRIu16 ")",
648 "Warning %s; Tag %s:\n Value %" PRIu32
649 " of NumberOfInks is different from the "
650 "SamplesPerPixel value %" PRIu16 "",
667 int tv_size, iCustom;
684 "%s: Ignored %stag \"%s\" (not supported by libtiff)",
694 "%s: Invalid %stag \"%s\" (not supported by codec)",
729 if (!new_customValues)
732 "%s: Failed to allocate space for list of "
770 mb = (
const char *)
va_arg(
ap,
const char *);
774 mb = (
const char *)
va_arg(
ap,
const char *);
776 if (
len >= 0x80000000U)
780 "%s: Too long string value for \"%s\". "
781 "Maximum supported is 2147483647 bytes",
810 "%s: Null count for \"%s\" (type "
811 "%d, writecount %d, passcount %d)",
819 "custom tag binary object");
847 tv->
count * tv_size);
857 if (pui64[
i] > 0xffffffffu)
861 "%s: Bad LONG8 value %" PRIu64
862 " at %d. array position for \"%s\" tag "
863 "%d in ClassicTIFF. Tag won't be "
867 goto badvalueifd8long8;
876 if (pi64[
i] > 2147483647 ||
877 pi64[
i] < (-2147483647 - 1))
881 "%s: Bad SLONG8 value %" PRIi64
882 " at %d. array position for \"%s\" tag "
883 "%d in ClassicTIFF. Tag won't be "
887 goto badvalueifd8long8;
950 "%s: Bad LONG8 or IFD8 value %" PRIu64
951 " for \"%s\" tag %d in ClassicTIFF. Tag "
952 "won't be written to file",
954 goto badvalueifd8long8;
965 ((
v2 > 2147483647) || (
v2 < (-2147483647 - 1))))
969 "%s: Bad SLONG8 value %" PRIi64
970 " for \"%s\" tag %d in ClassicTIFF. Tag "
971 "won't be written to file",
973 goto badvalueifd8long8;
1001 ".set_get_field_type "
1061 dblval, fip2 ? fip2->
field_name :
"Unknown");
1132 "%s: Cannot modify tag \"%s\" while writing",
1183 if (i < td->td_customValueCount)
1232 switch (standard_tag)
1436 "%s: Invalid %stag \"%s\" "
1437 "(not supported by codec)",
1550 ".set_get_field_type "
1607#define CleanupField(member) \
1611 _TIFFfreeExt(tif, td->member); \
1770#ifdef STRIPBYTECOUNTSORTED_UNUSED
1771 td->td_stripbytecountsorted = 1;
1816 (*_TIFFextender)(tif);
1841 static const char module[] =
"TIFFAdvanceDirectory";
1847 "Starting directory %u at offset 0x%" PRIx64 " (%" PRIu64
1848 ") might cause an IFD loop",
1849 *nextdirnum, *nextdiroff, *nextdiroff);
1860 tmsize_t poffa, poffb, poffc, poffd;
1865 if (((
uint64_t)poffa != poff) || (poffb < poffa) ||
1869 "%s:%d: %s: Error fetching directory count",
1870 __FILE__, __LINE__, tif->
tif_name);
1877 poffc = poffb + dircount * 12;
1879 if ((poffc < poffb) || (poffc < dircount * 12) || (poffd < poffc) ||
1890 *nextdiroff = nextdir32;
1894 tmsize_t poffa, poffb, poffc, poffd;
1900 "%s:%d: %s: Error fetching directory count",
1901 __FILE__, __LINE__, tif->
tif_name);
1909 "%s:%d: %s: Error fetching directory count",
1910 __FILE__, __LINE__, tif->
tif_name);
1916 if (dircount64 > 0xFFFF)
1919 "Sanity check on directory count failed");
1929 poffc = poffb + dircount16 * 20;
1949 if (!
SeekOK(tif, *nextdiroff) ||
1953 "%s:%d: %s: Error fetching directory count",
1954 __FILE__, __LINE__, tif->
tif_name);
1971 *nextdiroff = nextdir32;
1977 if (!
SeekOK(tif, *nextdiroff) ||
1981 "%s:%d: %s: Error fetching directory count",
1982 __FILE__, __LINE__, tif->
tif_name);
1987 if (dircount64 > 0xFFFF)
1990 "%s:%d: %s: Error fetching directory count",
1991 __FILE__, __LINE__, tif->
tif_name);
2009 if (*nextdiroff != 0)
2018 "the next directory %u at offset 0x%" PRIx64 " (%" PRIu64
2019 ") might be an IFD loop. Treating directory %d as "
2021 *nextdirnum, *nextdiroff, *nextdiroff, (
int)(*nextdirnum) - 1);
2043 while (nextdiroff != 0 &&
2091 const int relative = (dirn >= tif->
tif_curdir) &&
2109 for (
n = dirn;
n > 0 && nextdiroff != 0;
n--)
2114 if (nextdiroff == 0 ||
n > 0)
2166 int8_t probablySubIFD = 0;
2239 static const char module[] =
"TIFFUnlinkDirectory";
2248 "Can not unlink directory in read-only file");
2254 "For TIFFUnlinkDirectory() first directory starts with "
2255 "number 1 and not 0");
2275 for (
n = dirn - 1;
n > 0;
n--)
static unsigned char bytes[4]
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
for(i=0;i< ARRAY_SIZE(offsets);i++)
GLfloat GLfloat GLfloat GLfloat v3
GLfloat GLfloat GLfloat v2
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
static float(__cdecl *square_half_float)(float x
uint16_t td_pagenumber[2]
uint32_t td_dirdatasize_Noffsets
uint64_t td_dirdatasize_read
uint16_t td_threshholding
uint16_t td_minsamplevalue
double * td_sminsamplevalue
uint16_t td_bitspersample
TIFFDirEntry td_stripoffset_entry
uint16_t * td_transferfunction[3]
uint16_t td_maxsamplevalue
uint32_t td_fieldsset[FIELDSET_ITEMS]
uint16_t td_resolutionunit
TIFFTagValue * td_customValues
double * td_smaxsamplevalue
uint64_t * td_stripbytecount_p
unsigned char td_iswrittentofile
uint64_t * td_stripoffset_p
uint16_t * td_colormap[3]
uint16_t td_ycbcrsubsampling[2]
uint64_t td_dirdatasize_write
uint16_t td_samplesperpixel
TIFFDirEntry td_stripbytecount_entry
uint32_t td_stripoffsetbyteallocsize
TIFFEntryOffsetAndLength * td_dirdatasize_offsets
uint16_t td_ycbcrpositioning
uint16_t td_halftonehints[2]
unsigned char field_oktochange
unsigned char field_passcount
const TIFFField * tif_foundfield
TIFFTagMethods tif_tagmethods
int tif_setdirectory_force_absolute
tmsize_t tif_rawdataloaded
TIFFPostMethod tif_postdecode
TIFFVoidMethod tif_cleanup
TIFFHeaderUnion tif_header
TIFFFieldArray * tif_fieldscompat
void * _TIFFCheckMalloc(TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what)
float _TIFFClampDoubleToFloat(double val)
tmsize_t _TIFFMultiplySSize(TIFF *tif, tmsize_t first, tmsize_t second, const char *where)
void _TIFFCleanupIFDOffsetAndNumberMaps(TIFF *tif)
int TIFFSetCompressionScheme(TIFF *tif, int scheme)
void _TIFFsetLongArray(uint32_t **lpp, const uint32_t *lp, uint32_t n)
tdir_t TIFFNumberOfDirectories(TIFF *tif)
static void setByteArray(TIFF *tif, void **vpp, const void *vp, size_t nmemb, size_t elem_size)
int TIFFUnsetField(TIFF *tif, uint32_t tag)
int TIFFVGetField(TIFF *tif, uint32_t tag, va_list ap)
void _TIFFsetLongArrayExt(TIFF *tif, uint32_t **lpp, const uint32_t *lp, uint32_t n)
int TIFFSetSubDirectory(TIFF *tif, uint64_t diroff)
void _TIFFsetByteArray(void **vpp, const void *vp, uint32_t n)
void TIFFFreeDirectory(TIFF *tif)
void _TIFFsetFloatArrayExt(TIFF *tif, float **fpp, const float *fp, uint32_t n)
int TIFFLastDirectory(TIFF *tif)
int TIFFCreateGPSDirectory(TIFF *tif)
static void _TIFFsetNString(TIFF *tif, char **cpp, const char *cp, uint32_t n)
int TIFFSetField(TIFF *tif, uint32_t tag,...)
static void _TIFFsetLong8Array(TIFF *tif, uint64_t **lpp, const uint64_t *lp, uint32_t n)
void _TIFFsetByteArrayExt(TIFF *tif, void **vpp, const void *vp, uint32_t n)
#define CleanupField(member)
int TIFFDefaultDirectory(TIFF *tif)
int TIFFSetDirectory(TIFF *tif, tdir_t dirn)
static void setDoubleArrayOneValue(TIFF *tif, double **vpp, double value, size_t nmemb)
void _TIFFsetDoubleArray(double **dpp, const double *dp, uint32_t n)
int TIFFUnlinkDirectory(TIFF *tif, tdir_t dirn)
static int _TIFFVGetField(TIFF *tif, uint32_t tag, va_list ap)
int TIFFCreateDirectory(TIFF *tif)
void _TIFFsetDoubleArrayExt(TIFF *tif, double **dpp, const double *dp, uint32_t n)
int TIFFCreateCustomDirectory(TIFF *tif, const TIFFFieldArray *infoarray)
int TIFFCreateEXIFDirectory(TIFF *tif)
static int OkToChangeTag(TIFF *tif, uint32_t tag)
void _TIFFsetShortArray(uint16_t **wpp, const uint16_t *wp, uint32_t n)
static int _TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
static int TIFFAdvanceDirectory(TIFF *tif, uint64_t *nextdiroff, uint64_t *off, tdir_t *nextdirnum)
#define EXTRASAMPLE_COREL_UNASSALPHA
TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc extender)
static uint16_t countInkNamesString(TIFF *tif, uint32_t slen, const char *s)
static int setExtraSamples(TIFF *tif, va_list ap, uint32_t *v)
int TIFFGetField(TIFF *tif, uint32_t tag,...)
void _TIFFsetShortArrayExt(TIFF *tif, uint16_t **wpp, const uint16_t *wp, uint32_t n)
static TIFFExtendProc _TIFFextender
int TIFFVSetField(TIFF *tif, uint32_t tag, va_list ap)
uint64_t TIFFCurrentDirOffset(TIFF *tif)
void _TIFFsetFloatArray(float **fpp, const float *fp, uint32_t n)
#define FIELD_TRANSFERFUNCTION
#define FIELD_SMAXSAMPLEVALUE
#define FIELD_YCBCRSUBSAMPLING
#define FIELD_SMINSAMPLEVALUE
#define TIFFFieldSet(tif, field)
#define FIELD_NUMBEROFINKS
#define FIELD_TILEDIMENSIONS
#define FIELD_COMPRESSION
#define FIELD_YCBCRPOSITIONING
#define TIFFClrFieldBit(tif, field)
#define TIFFSetFieldBit(tif, field)
#define FIELD_SAMPLESPERPIXEL
const TIFFField * TIFFFieldWithTag(TIFF *tif, uint32_t tag)
static const TIFFFieldArray exifFieldArray
const TIFFField * TIFFFindField(TIFF *tif, uint32_t tag, TIFFDataType dt)
const TIFFFieldArray * _TIFFGetFields(void)
static const TIFFFieldArray tiffFieldArray
static const TIFFFieldArray gpsFieldArray
void _TIFFSetupFields(TIFF *tif, const TIFFFieldArray *fieldarray)
const TIFFFieldArray * _TIFFGetGpsFields(void)
int TIFFFieldSetGetSize(const TIFFField *fip)
const TIFFFieldArray * _TIFFGetExifFields(void)
int _TIFFCheckDirNumberAndOffset(TIFF *tif, tdir_t dirn, uint64_t diroff)
int _TIFFGetOffsetFromDirNumber(TIFF *tif, tdir_t dirn, uint64_t *diroff)
int _TIFFGetDirNumberFromOffset(TIFF *tif, uint64_t diroff, tdir_t *dirn)
int _TIFFFillStriles(TIFF *tif)
int TIFFReadDirectory(TIFF *tif)
void TIFFErrorExtR(TIFF *tif, const char *module, const char *fmt,...)
void _TIFFfreeExt(TIFF *tif, void *p)
void * _TIFFreallocExt(TIFF *tif, void *p, tmsize_t s)
void * _TIFFmallocExt(TIFF *tif, tmsize_t s)
void _TIFFNoPostDecode(TIFF *tif, uint8_t *buf, tmsize_t cc)
void _TIFFSwab24BitData(TIFF *tif, uint8_t *buf, tmsize_t cc)
void _TIFFSwab16BitData(TIFF *tif, uint8_t *buf, tmsize_t cc)
void _TIFFSwab32BitData(TIFF *tif, uint8_t *buf, tmsize_t cc)
void _TIFFSwab64BitData(TIFF *tif, uint8_t *buf, tmsize_t cc)
void TIFFSwabLong8(uint64_t *lp)
void TIFFSwabShort(uint16_t *wp)
void TIFFSwabLong(uint32_t *lp)
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,...)
#define TIFFTAG_BITSPERSAMPLE
#define PLANARCONFIG_SEPARATE
#define TIFFTAG_RESOLUTIONUNIT
#define EXTRASAMPLE_UNASSALPHA
#define YCBCRPOSITION_CENTERED
#define RESUNIT_CENTIMETER
#define EXTRASAMPLE_ASSOCALPHA
#define ORIENTATION_TOPLEFT
#define TIFFTAG_FILLORDER
#define TIFFTAG_SAMPLESPERPIXEL
#define TIFFTAG_YPOSITION
#define FILLORDER_LSB2MSB
#define SAMPLEFORMAT_COMPLEXINT
#define SAMPLEFORMAT_UINT
#define TIFFTAG_IMAGEDEPTH
#define TIFFTAG_PHOTOMETRIC
#define TIFFTAG_TILELENGTH
#define TIFFTAG_MAXSAMPLEVALUE
#define TIFFTAG_TILEDEPTH
#define TIFFTAG_EXTRASAMPLES
#define TIFFTAG_IMAGEWIDTH
#define TIFFTAG_XRESOLUTION
#define TIFFTAG_ORIENTATION
#define TIFFTAG_HALFTONEHINTS
#define TIFFTAG_MINSAMPLEVALUE
#define TIFFTAG_NUMBEROFINKS
#define SAMPLEFORMAT_IEEEFP
#define TIFFTAG_TRANSFERFUNCTION
#define TIFFTAG_YRESOLUTION
#define TIFFTAG_TILEBYTECOUNTS
#define TIFFTAG_STRIPBYTECOUNTS
#define TIFFTAG_SMINSAMPLEVALUE
#define TIFFTAG_YCBCRSUBSAMPLING
#define FILLORDER_MSB2LSB
#define TIFFTAG_TILEOFFSETS
#define TIFFTAG_ROWSPERSTRIP
#define ORIENTATION_LEFTBOT
#define TIFFTAG_SMAXSAMPLEVALUE
#define TIFFTAG_SAMPLEFORMAT
#define TIFFTAG_PERSAMPLE
#define SAMPLEFORMAT_COMPLEXIEEEFP
#define TIFFTAG_REFERENCEBLACKWHITE
#define TIFFTAG_TILEWIDTH
#define TIFFTAG_IMAGELENGTH
#define TIFFTAG_PAGENUMBER
#define THRESHHOLD_BILEVEL
#define TIFFTAG_COMPRESSION
#define TIFFTAG_PLANARCONFIG
#define TIFFTAG_STRIPOFFSETS
#define TIFFTAG_SUBFILETYPE
#define TIFFTAG_XPOSITION
#define SAMPLEFORMAT_VOID
#define TIFFTAG_YCBCRPOSITIONING
#define TIFFTAG_THRESHHOLDING
#define PLANARCONFIG_CONTIG
#define TIFF_TMSIZE_T_MAX
void(* TIFFExtendProc)(TIFF *)
#define TIFF_NON_EXISTENT_DIR_NUMBER
#define WriteOK(tif, buf, size)
#define ReadOK(tif, buf, size)
#define TIFFSeekFile(tif, off, whence)
void int int ULONGLONG int va_list * ap