BigTIFF upgrade in progress - widespread temp mess - does not compile now

This commit is contained in:
Joris Van Damme 2007-05-11 14:41:01 +00:00
parent be0e76da4d
commit b91bad77c0
4 changed files with 114 additions and 190 deletions

View File

@ -1,4 +1,4 @@
/* $Id: tif_dirinfo.c,v 1.76 2007-05-11 05:44:10 joris Exp $ */
/* $Id: tif_dirinfo.c,v 1.77 2007-05-11 14:41:01 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -56,8 +56,8 @@ tiffFieldInfo[] = {
{ TIFFTAG_FILLORDER, 1, 1, TIFF_SHORT, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_FILLORDER, 0, 0, "FillOrder" },
{ TIFFTAG_DOCUMENTNAME, -1, -1, TIFF_ASCII, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DocumentName" },
{ TIFFTAG_IMAGEDESCRIPTION, -1, -1, TIFF_ASCII, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageDescription" },
{ TIFFTAG_MAKE, -1, -1, TIFF_ASCII, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Make" },
{ TIFFTAG_MODEL, -1, -1, TIFF_ASCII, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Model" },
{ TIFFTAG_MAKE, -1, -1, TIFF_ASCII, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Make" },
{ TIFFTAG_MODEL, -1, -1, TIFF_ASCII, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Model" },
{ TIFFTAG_STRIPOFFSETS, -1, -1, TIFF_LONG8, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_STRIPOFFSETS, 0, 0, "StripOffsets" },
{ TIFFTAG_ORIENTATION, 1, 1, TIFF_SHORT, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_ORIENTATION, 0, 0, "Orientation" },
{ TIFFTAG_SAMPLESPERPIXEL, 1, 1, TIFF_SHORT, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_SAMPLESPERPIXEL, 0, 0, "SamplesPerPixel" },
@ -82,7 +82,7 @@ tiffFieldInfo[] = {
{ TIFFTAG_SOFTWARE, -1, -1, TIFF_ASCII, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Software" },
{ TIFFTAG_DATETIME, 20, 20, TIFF_ASCII, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DateTime" },
{ TIFFTAG_ARTIST, -1, -1, TIFF_ASCII, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Artist" },
{ TIFFTAG_HOSTCOMPUTER, -1, -1, TIFF_ASCII, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "HostComputer" },
{ TIFFTAG_HOSTCOMPUTER, -1, -1, TIFF_ASCII, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "HostComputer" },
{ TIFFTAG_WHITEPOINT, 2, 2, TIFF_RATIONAL, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "WhitePoint" },
{ TIFFTAG_PRIMARYCHROMATICITIES, 6, 6, TIFF_RATIONAL, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "PrimaryChromaticities" },
{ TIFFTAG_COLORMAP, -1, -1, TIFF_SHORT, TIFF_SETGET_OTHER, TIFF_SETGET_UNDEFINED, FIELD_COLORMAP, 1, 0, "ColorMap" },
@ -94,80 +94,42 @@ tiffFieldInfo[] = {
{ TIFFTAG_SUBIFD, -1, -1, TIFF_IFD8, TIFF_SETGET_C16_UINT64, TIFF_SETGET_UNDEFINED, FIELD_SUBIFD, 1, 1, "SubIFD" },
{ TIFFTAG_INKSET, 1, 1, TIFF_SHORT, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InkSet" },
{ TIFFTAG_INKNAMES, -1, -1, TIFF_ASCII, TIFF_SETGET_C16_ASCII, TIFF_SETGET_UNDEFINED, FIELD_INKNAMES, 1, 1, "InkNames" },
{ TIFFTAG_NUMBEROFINKS, 1, 1, TIFF_SHORT, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
1, 0, "NumberOfInks" },
{ TIFFTAG_DOTRANGE, 2, 2, TIFF_SHORT, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "DotRange" },
{ TIFFTAG_DOTRANGE, 2, 2, TIFF_BYTE, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "DotRange" },
{ TIFFTAG_TARGETPRINTER, -1,-1, TIFF_ASCII, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
1, 0, "TargetPrinter" },
{ TIFFTAG_NUMBEROFINKS, 1, 1, TIFF_SHORT, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "NumberOfInks" },
{ TIFFTAG_DOTRANGE, 2, 2, TIFF_SHORT, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "DotRange" },
{ TIFFTAG_TARGETPRINTER, -1, -1, TIFF_ASCII, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TargetPrinter" },
{ TIFFTAG_EXTRASAMPLES, -1, -1, TIFF_SHORT, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_EXTRASAMPLES, 0, 1, "ExtraSamples" },
{ TIFFTAG_SAMPLEFORMAT, -1, -1, TIFF_SHORT, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_SAMPLEFORMAT, 0, 0, "SampleFormat" },
{ TIFFTAG_SMINSAMPLEVALUE, -2, -1, TIFF_ANY, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_SMINSAMPLEVALUE, 1, 0, "SMinSampleValue" },
{ TIFFTAG_SMAXSAMPLEVALUE, -2, -1, TIFF_ANY, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_SMAXSAMPLEVALUE, 1, 0, "SMaxSampleValue" },
{ TIFFTAG_CLIPPATH, -1, -3, TIFF_BYTE, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 1, "ClipPath" },
{ TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_SLONG, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "XClipPathUnits" },
{ TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_SSHORT, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "XClipPathUnits" },
{ TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_SBYTE, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "XClipPathUnits" },
{ TIFFTAG_YCLIPPATHUNITS, 1, 1, TIFF_SLONG, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "YClipPathUnits" },
{ TIFFTAG_YCLIPPATHUNITS, 1, 1, TIFF_SSHORT, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "YClipPathUnits" },
{ TIFFTAG_YCLIPPATHUNITS, 1, 1, TIFF_SBYTE, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "YClipPathUnits" },
{ TIFFTAG_CLIPPATH, -1, -3, TIFF_BYTE, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ClipPath" },
{ TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_SLONG, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "XClipPathUnits" },
{ TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_SBYTE, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "XClipPathUnits" },
{ TIFFTAG_YCLIPPATHUNITS, 1, 1, TIFF_SLONG, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "YClipPathUnits" },
{ TIFFTAG_YCBCRCOEFFICIENTS, 3, 3, TIFF_RATIONAL, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "YCbCrCoefficients" },
{ TIFFTAG_YCBCRSUBSAMPLING, 2, 2, TIFF_SHORT, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UNDEFINED, FIELD_YCBCRSUBSAMPLING, 0, 0, "YCbCrSubsampling" },
{ TIFFTAG_YCBCRPOSITIONING, 1, 1, TIFF_SHORT, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_YCBCRPOSITIONING, 0, 0, "YCbCrPositioning" },
{ TIFFTAG_REFERENCEBLACKWHITE, 6, 6, TIFF_RATIONAL, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
1, 0, "ReferenceBlackWhite" },
/* XXX temporarily accept LONG for backwards compatibility */
{ TIFFTAG_REFERENCEBLACKWHITE, 6, 6, TIFF_LONG, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
1, 0, "ReferenceBlackWhite" },
{ TIFFTAG_XMLPACKET, -3,-3, TIFF_BYTE, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 1, "XMLPacket" },
/* begin SGI tags */
{ TIFFTAG_REFERENCEBLACKWHITE, 6, 6, TIFF_RATIONAL, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ReferenceBlackWhite" },
{ TIFFTAG_XMLPACKET, -3, -3, TIFF_BYTE, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "XMLPacket" },
/* begin SGI tags */
{ TIFFTAG_MATTEING, 1, 1, TIFF_SHORT, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_EXTRASAMPLES, 0, 0, "Matteing" },
{ TIFFTAG_DATATYPE, -2, -1, TIFF_SHORT, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_SAMPLEFORMAT, 0, 0, "DataType" },
{ TIFFTAG_IMAGEDEPTH, 1, 1, TIFF_LONG, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_IMAGEDEPTH, 0, 0, "ImageDepth" },
{ TIFFTAG_TILEDEPTH, 1, 1, TIFF_LONG, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_TILEDEPTH, 0, 0, "TileDepth" },
/* end SGI tags */
/* begin Pixar tags */
{ TIFFTAG_PIXAR_IMAGEFULLWIDTH, 1, 1, TIFF_LONG, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
1, 0, "ImageFullWidth" },
{ TIFFTAG_PIXAR_IMAGEFULLLENGTH, 1, 1, TIFF_LONG, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
1, 0, "ImageFullLength" },
{ TIFFTAG_PIXAR_TEXTUREFORMAT, -1, -1, TIFF_ASCII, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
1, 0, "TextureFormat" },
{ TIFFTAG_PIXAR_WRAPMODES, -1, -1, TIFF_ASCII, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
1, 0, "TextureWrapModes" },
{ TIFFTAG_PIXAR_FOVCOT, 1, 1, TIFF_FLOAT, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
1, 0, "FieldOfViewCotangent" },
{ TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN, 16,16, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, TIFF_FLOAT,
FIELD_CUSTOM, 1, 0, "MatrixWorldToScreen" },
{ TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA, 16,16, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, TIFF_FLOAT,
FIELD_CUSTOM, 1, 0, "MatrixWorldToCamera" },
{ TIFFTAG_COPYRIGHT, -1, -1, TIFF_ASCII, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
1, 0, "Copyright" },
/* end Pixar tags */
{ TIFFTAG_RICHTIFFIPTC, -3, -3, TIFF_LONG, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 1, "RichTIFFIPTC" },
{ TIFFTAG_PHOTOSHOP, -3, -3, TIFF_BYTE, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 1, "Photoshop" },
{ TIFFTAG_EXIFIFD, 1, 1, TIFF_LONG, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "EXIFIFDOffset" },
{ TIFFTAG_EXIFIFD, 1, 1, TIFF_IFD, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "EXIFIFDOffset" },
{ TIFFTAG_EXIFIFD, 1, 1, TIFF_LONG8, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "EXIFIFDOffset" },
{ TIFFTAG_EXIFIFD, 1, 1, TIFF_IFD8, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "EXIFIFDOffset" },
{ TIFFTAG_ICCPROFILE, -3, -3, TIFF_UNDEFINED, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 1, "ICC Profile" },
/* end SGI tags */
/* begin Pixar tags */
{ TIFFTAG_PIXAR_IMAGEFULLWIDTH, 1, 1, TIFF_LONG, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageFullWidth" },
{ TIFFTAG_PIXAR_IMAGEFULLLENGTH, 1, 1, TIFF_LONG, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageFullLength" },
{ TIFFTAG_PIXAR_TEXTUREFORMAT, -1, -1, TIFF_ASCII, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TextureFormat" },
{ TIFFTAG_PIXAR_WRAPMODES, -1, -1, TIFF_ASCII, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TextureWrapModes" },
{ TIFFTAG_PIXAR_FOVCOT, 1, 1, TIFF_FLOAT, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FieldOfViewCotangent" },
{ TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN, 16, 16, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, TIFF_FLOAT, FIELD_CUSTOM, 1, 0, "MatrixWorldToScreen" },
{ TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA, 16, 16, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, TIFF_FLOAT, FIELD_CUSTOM, 1, 0, "MatrixWorldToCamera" },
{ TIFFTAG_COPYRIGHT, -1, -1, TIFF_ASCII, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Copyright" },
/* end Pixar tags */
{ TIFFTAG_RICHTIFFIPTC, -3, -3, TIFF_LONG, TIFF_SETGET_C32_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "RichTIFFIPTC" },
{ TIFFTAG_PHOTOSHOP, -3, -3, TIFF_BYTE, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "Photoshop" },
{ TIFFTAG_EXIFIFD, 1, 1, TIFF_IFD8, TIFF_SETGET_UINT64, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "EXIFIFDOffset" },
{ TIFFTAG_ICCPROFILE, -3, -3, TIFF_UNDEFINED, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ICC Profile" },
{ TIFFTAG_GPSIFD, 1, 1, TIFF_LONG, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
0, 0, "GPSIFDOffset" },
{ TIFFTAG_GPSIFD, 1, 1, TIFF_IFD, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM,
@ -432,48 +394,6 @@ exifFieldInfo[] = {
set documentation
TIFFTAG_COPYRIGHT
1
char*
TIFFTAG_DOTRANGE
2
uint16
TIFFTAG_HOSTCOMPUTER
1
char*
TIFFTAG_ICCPROFILE
2
uint32,void*
count, profile data
TIFFTAG_INKSET
@ -486,16 +406,6 @@ uint16
TIFFTAG_MAKE
1
char*
TIFFTAG_MATTEING
@ -508,28 +418,6 @@ uint16
TIFFTAG_MODEL
1
char*
TIFFTAG_PHOTOSHOP
?
uint32,void*
count, data
TIFFTAG_PRIMARYCHROMATICITIES
@ -554,18 +442,6 @@ float*
2*SamplesPerPixel array
TIFFTAG_RICHTIFFIPTC
2
uint32,void*
count, data
TIFFTAG_TARGETPRINTER
@ -588,29 +464,6 @@ float*
2-entry array
TIFFTAG_XMLPACKET
2
uint32,void*
count, data
TIFFTAG_YCBCRSAMPLING
2
uint16
missing:
TIFFTAG_DATATYPE, 1, uint16
TIFFTAG_YCBCRSUBSAMPLING, 2, uint16,uint16
@ -637,6 +490,7 @@ TIFFTAG_XRESOLUTION, 1, double
TIFFTAG_YRESOLUTION, 1, double
TIFFTAG_XPOSITION, 1, double
TIFFTAG_YPOSITION, 1, double
TIFFTAG_EXIFIFD, 1, uint64
changed:
TIFFTAG_SUBIFD, 2, uint16,uint64*, count & offsets array
@ -996,6 +850,18 @@ _TIFFCreateAnonFieldInfo(TIFF *tif, uint32 tag, TIFFDataType field_type)
fld->set_field_type = TIFF_SETGET_C32_ASCII;
fld->get_field_type = TIFF_SETGET_C32_ASCII;
break;
case TIFF_UNDEFINED:
fld->set_field_type = TIFF_SETGET_C32_UINT8;
fld->get_field_type = TIFF_SETGET_C32_UINT8;
break;
case TIFF_SHORT:
fld->set_field_type = TIFF_SETGET_C32_UINT16;
fld->get_field_type = TIFF_SETGET_C32_UINT16;
break;
case TIFF_LONG:
fld->set_field_type = TIFF_SETGET_C32_UINT32;
fld->get_field_type = TIFF_SETGET_C32_UINT32;
break;
default:
assert(0);
break;

View File

@ -1,4 +1,4 @@
/* $Id: tif_dirread.c,v 1.110 2007-05-11 05:44:10 joris Exp $ */
/* $Id: tif_dirread.c,v 1.111 2007-05-11 14:41:01 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -2616,12 +2616,6 @@ TIFFReadDirectory(TIFF* tif)
}
}
break;
case TIFFTAG_PAGENUMBER:
case TIFFTAG_HALFTONEHINTS:
case TIFFTAG_YCBCRSUBSAMPLING:
case TIFFTAG_DOTRANGE:
(void) TIFFFetchShortPair(tif,dp,1);
break;
case TIFFTAG_REFERENCEBLACKWHITE:
(void) TIFFFetchRefBlackWhite(tif,dp);
break;
@ -3741,6 +3735,8 @@ TIFFFetchShortArray(TIFF* tif, TIFFDirEntry* dir, uint16* v)
static int
TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir, int recover)
{
assert(0);
#ifdef NDEF
static const char module[] = "TIFFFetchShortPair";
enum TIFFReadDirEntryErr err;
uint16* data;
@ -3765,6 +3761,7 @@ TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir, int recover)
}
_TIFFfree(data);
return 1;
#endif
}
/*
@ -3950,6 +3947,7 @@ TIFFFetchAnyArray(TIFF* tif, TIFFDirEntry* dir, double* v)
static int
TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp)
{
static const char module[] = "TIFFFetchNormalTag";
enum TIFFReadDirEntryErr err;
uint32 fii;
const TIFFFieldInfo* fip;
@ -3981,9 +3979,21 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp)
mb++;
}
if (mb+1<(uint32)dp->tdir_count)
assert(0);
TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" contains null byte in value; value incorrectly truncated during reading due to implementation limitations",fip->field_name);
else if (mb+1>(uint32)dp->tdir_count)
assert(0);
{
char* n;
TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte",fip->field_name);
if ((uint32)dp->tdir_count+1!=dp->tdir_count+1)
assert(0);
n=_TIFFmalloc((uint32)dp->tdir_count+1);
if (n==0)
assert(0);
_TIFFmemcpy(n,data,(uint32)dp->tdir_count);
n[(uint32)dp->tdir_count]=0;
_TIFFfree(data);
data=n;
}
if (!TIFFSetField(tif,dp->tdir_tag,data))
assert(0);
_TIFFfree(data);
@ -4049,7 +4059,23 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp)
assert(0);
break;
case TIFF_SETGET_UINT16_PAIR:
assert(0);
{
uint16* data;
assert(fip->field_readcount==2);
assert(fip->field_passcount==0);
if (dp->tdir_count!=2)
assert(0);
else
{
err=TIFFReadDirEntryShortArray(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
if (!TIFFSetField(tif,dp->tdir_tag,data[0],data[1]))
assert(0);
_TIFFfree(data);
}
}
}
break;
case TIFF_SETGET_C0_FLOAT:
{
@ -4123,6 +4149,34 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp)
}
}
break;
case TIFF_SETGET_C32_UINT16:
{
uint16* data;
assert(fip->field_readcount==TIFF_VARIABLE2);
assert(fip->field_passcount==1);
err=TIFFReadDirEntryShortArray(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
if (!TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data))
assert(0);
_TIFFfree(data);
}
}
break;
case TIFF_SETGET_C32_UINT32:
{
uint32* data;
assert(fip->field_readcount==TIFF_VARIABLE2);
assert(fip->field_passcount==1);
err=TIFFReadDirEntryLongArray(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
if (!TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data))
assert(0);
_TIFFfree(data);
}
}
break;
case TIFF_SETGET_C32_UINT64:
{
uint64_new* data;

View File

@ -1,4 +1,4 @@
/* $Id: tif_strip.c,v 1.23 2007-04-04 04:16:08 joris Exp $ */
/* $Id: tif_strip.c,v 1.24 2007-05-11 14:41:01 joris Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@ -310,6 +310,8 @@ TIFFScanlineSize64(TIFF* tif)
assert(td->td_samplesperpixel==3);
TIFFGetField(tif,TIFFTAG_YCBCRSUBSAMPLING,ycbcrsubsampling+0,
ycbcrsubsampling+1);
assert((ycbcrsubsampling[0]==1)||(ycbcrsubsampling[0]==2)||(ycbcrsubsampling[0]==4));
assert((ycbcrsubsampling[1]==1)||(ycbcrsubsampling[1]==2)||(ycbcrsubsampling[1]==4));
if (ycbcrsubsampling[0]*ycbcrsubsampling[1]==0)
{
TIFFErrorExt(tif->tif_clientdata,module,

View File

@ -1,4 +1,4 @@
/* $Id: tiff.h,v 1.51 2007-05-11 05:44:11 joris Exp $ */
/* $Id: tiff.h,v 1.52 2007-05-11 14:41:01 joris Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -183,8 +183,10 @@ typedef enum {
TIFF_SETGET_C16_UINT64 = 12,
TIFF_SETGET_C32_ASCII = 13,
TIFF_SETGET_C32_UINT8 = 14,
TIFF_SETGET_C32_UINT64 = 15,
TIFF_SETGET_OTHER = 16,
TIFF_SETGET_C32_UINT16 = 15,
TIFF_SETGET_C32_UINT32 = 16,
TIFF_SETGET_C32_UINT64 = 17,
TIFF_SETGET_OTHER = 18,
} TIFFSetGetFieldType;
/*