diff options
author | Joris Van Damme <joris.at.lebbeke@skynet.be> | 2005-12-21 12:23:13 +0000 |
---|---|---|
committer | Joris Van Damme <joris.at.lebbeke@skynet.be> | 2005-12-21 12:23:13 +0000 |
commit | 5cbfc68f0625d6c29d724b6e57fa7e98017ad325 (patch) | |
tree | 78796f9d7b231ba6b69e2675e2b342f81e21dc50 /contrib | |
parent | 839c207d313ccf068c98aa4d466e81fdf1aef27b (diff) | |
download | libtiff-git-5cbfc68f0625d6c29d724b6e57fa7e98017ad325.tar.gz |
*** empty log message ***
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/addtiffo/tif_overview.c | 20 | ||||
-rw-r--r-- | contrib/addtiffo/tif_ovrcache.c | 6 | ||||
-rw-r--r-- | contrib/pds/tif_imageiter.c | 22 | ||||
-rw-r--r-- | contrib/pds/tif_pdsdirread.c | 26 | ||||
-rw-r--r-- | contrib/pds/tif_pdsdirwrite.c | 22 | ||||
-rw-r--r-- | contrib/tags/maketif.c | 2 | ||||
-rw-r--r-- | contrib/tags/xtif_dir.c | 4 | ||||
-rw-r--r-- | contrib/win_dib/Tiffile.cpp | 2 |
8 files changed, 53 insertions, 51 deletions
diff --git a/contrib/addtiffo/tif_overview.c b/contrib/addtiffo/tif_overview.c index b8c2c9f6..e1ead59f 100644 --- a/contrib/addtiffo/tif_overview.c +++ b/contrib/addtiffo/tif_overview.c @@ -696,7 +696,7 @@ void TIFFBuildOverviews( TIFF *hTIFF, int nOverviews, int * panOvList, { TIFFOvrCache **papoRawBIs; - uint32 nXSize, nYSize, nBlockXSize, nBlockYSize; + uint32 nXSize, nYSize, nBlockXSize, nBlockYSize; uint16 nBitsPerPixel, nPhotometric, nCompressFlag, nSamples, nPlanarConfig, nSampleFormat; int bSubsampled; @@ -726,10 +726,11 @@ void TIFFBuildOverviews( TIFF *hTIFF, int nOverviews, int * panOvList, if( nBitsPerPixel != 8 || nSamples != 3 || nPlanarConfig != PLANARCONFIG_CONTIG || nSampleFormat != SAMPLEFORMAT_UINT) { - TIFFError( NULL, "TIFFBuildOverviews", - "File `%s' has an unsupported subsampling configuration.\n", - TIFFFileName(hTIFF) ); - /* If you need support for this particular flavor, please contact either + /* TODO: use of TIFFError is inconsistent with use of fprintf in addtiffo.c, sort out */ + TIFFErrorExt( hTIFF->tif_clientdata, "TIFFBuildOverviews", + "File `%s' has an unsupported subsampling configuration.\n", + TIFFFileName(hTIFF) ); + /* If you need support for this particular flavor, please contact either * Frank Warmerdam warmerdam@pobox.com * Joris Van Damme info@awaresystems.be */ @@ -743,10 +744,11 @@ void TIFFBuildOverviews( TIFF *hTIFF, int nOverviews, int * panOvList, { if( nBitsPerPixel < 8 ) { - TIFFError( NULL, "TIFFBuildOverviews", - "File `%s' has samples of %d bits per sample. Sample\n" - "sizes of less than 8 bits per sample are not supported.\n", - TIFFFileName(hTIFF), nBitsPerPixel ); + /* TODO: use of TIFFError is inconsistent with use of fprintf in addtiffo.c, sort out */ + TIFFErrorExt( hTIFF->tif_clientdata, "TIFFBuildOverviews", + "File `%s' has samples of %d bits per sample. Sample\n" + "sizes of less than 8 bits per sample are not supported.\n", + TIFFFileName(hTIFF), nBitsPerPixel ); return; } bSubsampled = 0; diff --git a/contrib/addtiffo/tif_ovrcache.c b/contrib/addtiffo/tif_ovrcache.c index 5cb2400d..e203a173 100644 --- a/contrib/addtiffo/tif_ovrcache.c +++ b/contrib/addtiffo/tif_ovrcache.c @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: tif_ovrcache.c,v 1.5 2005-12-16 05:59:55 fwarmerdam Exp $ + * $Id: tif_ovrcache.c,v 1.6 2005-12-21 12:23:13 joris Exp $ * * Project: TIFF Overview Builder * Purpose: Library functions to maintain two rows of tiles or two strips @@ -107,8 +107,8 @@ TIFFOvrCache *TIFFCreateOvrCache( TIFF *hTIFF, int nDirOffset ) if( psCache->pabyRow1Blocks == NULL || psCache->pabyRow2Blocks == NULL ) { - TIFFError( hTIFF->tif_name, - "Can't allocate memory for overview cache." ); + TIFFErrorExt( hTIFF->tif_clientdata, hTIFF->tif_name, + "Can't allocate memory for overview cache." ); /* TODO: use of TIFFError is inconsistent with use of fprintf in addtiffo.c, sort out */ return NULL; } diff --git a/contrib/pds/tif_imageiter.c b/contrib/pds/tif_imageiter.c index 9fc9760b..592f6e98 100644 --- a/contrib/pds/tif_imageiter.c +++ b/contrib/pds/tif_imageiter.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_imageiter.c,v 1.2 2004-05-19 17:14:45 dron Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_imageiter.c,v 1.3 2005-12-21 12:23:13 joris Exp $ */ /* * Copyright (c) 1991-1996 Sam Leffler @@ -113,7 +113,7 @@ TIFFImageIterBegin(TIFFImageIter* img, TIFF* tif, int stop, char emsg[1024]) case PHOTOMETRIC_PALETTE: if (!TIFFGetField(tif, TIFFTAG_COLORMAP, &img->redcmap, &img->greencmap, &img->bluecmap)) { - TIFFError(TIFFFileName(tif), "Missing required \"Colormap\" tag"); + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Missing required \"Colormap\" tag"); return (0); } /* fall thru... */ @@ -211,12 +211,12 @@ int TIFFImageIterGet(TIFFImageIter* img, void *udata, uint32 w, uint32 h) { if (img->get == NULL) { - TIFFError(TIFFFileName(img->tif), "No \"get\" routine setup"); + TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No \"get\" routine setup"); return (0); } if (img->callback.any == NULL) { - TIFFError(TIFFFileName(img->tif), - "No \"put\" routine setupl; probably can not handle image format"); + TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), + "No \"put\" routine setupl; probably can not handle image format"); return (0); } return (*img->get)(img, udata, w, h); @@ -243,7 +243,7 @@ TIFFReadImageIter(TIFF* tif, ok = TIFFImageIterGet(&img, raster, rwidth, img.height); TIFFImageIterEnd(&img); } else { - TIFFError(TIFFFileName(tif), emsg); + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), emsg); ok = 0; } return (ok); @@ -270,7 +270,7 @@ gtTileContig(TIFFImageIter* img, void *udata, uint32 w, uint32 h) buf = (u_char*) _TIFFmalloc(TIFFTileSize(tif)); if (buf == 0) { - TIFFError(TIFFFileName(tif), "No space for tile buffer"); + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for tile buffer"); return (0); } TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw); @@ -325,7 +325,7 @@ gtTileSeparate(TIFFImageIter* img, void *udata, uint32 w, uint32 h) tilesize = TIFFTileSize(tif); buf = (u_char*) _TIFFmalloc(4*tilesize); if (buf == 0) { - TIFFError(TIFFFileName(tif), "No space for tile buffer"); + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for tile buffer"); return (0); } r = buf; @@ -386,7 +386,7 @@ gtStripContig(TIFFImageIter* img, void *udata, uint32 w, uint32 h) buf = (u_char*) _TIFFmalloc(TIFFStripSize(tif)); if (buf == 0) { - TIFFError(TIFFFileName(tif), "No space for strip buffer"); + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer"); return (0); } orientation = img->orientation; @@ -429,7 +429,7 @@ gtStripSeparate(TIFFImageIter* img, void *udata, uint32 w, uint32 h) stripsize = TIFFStripSize(tif); r = buf = (u_char *)_TIFFmalloc(4*stripsize); if (buf == 0) { - TIFFError(TIFFFileName(tif), "No space for tile buffer"); + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for tile buffer"); return (0); } g = r + stripsize; @@ -510,7 +510,7 @@ main(int argc, char **argv) ok = TIFFImageIterGet(&img, NULL, img.width, img.height); TIFFImageIterEnd(&img); } else { - TIFFError(TIFFFileName(tif), emsg); + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), emsg); } } diff --git a/contrib/pds/tif_pdsdirread.c b/contrib/pds/tif_pdsdirread.c index 00590ec5..b09ab314 100644 --- a/contrib/pds/tif_pdsdirread.c +++ b/contrib/pds/tif_pdsdirread.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_pdsdirread.c,v 1.2 2003-11-17 15:09:39 dron Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_pdsdirread.c,v 1.3 2005-12-21 12:23:13 joris Exp $ */ /* * Copyright (c) 1988-1996 Sam Leffler @@ -89,7 +89,7 @@ CheckMalloc(TIFF* tif, tsize_t n, const char* what) { char *cp = (char*)_TIFFmalloc(n); if (cp == NULL) - TIFFError(tif->tif_name, "No space %s", what); + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "No space %s", what); return (cp); } @@ -137,12 +137,12 @@ TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset, if (!isMapped(tif)) { if (!SeekOK(tif, pdir_offset)) { - TIFFError(tif->tif_name, + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Seek error accessing TIFF private subdirectory"); return (0); } if (!ReadOK(tif, &dircount, sizeof (uint16))) { - TIFFError(tif->tif_name, + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Can not read TIFF private subdirectory count"); return (0); } @@ -153,7 +153,7 @@ TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset, if (dir == NULL) return (0); if (!ReadOK(tif, dir, dircount*sizeof (TIFFDirEntry))) { - TIFFError(tif->tif_name, "Can not read TIFF private subdirectory"); + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Can not read TIFF private subdirectory"); goto bad; } /* @@ -164,7 +164,7 @@ TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset, toff_t off = pdir_offset; if (off + sizeof (short) > tif->tif_size) { - TIFFError(tif->tif_name, + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Can not read TIFF private subdirectory count"); return (0); } else @@ -177,7 +177,7 @@ TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset, if (dir == NULL) return (0); if (off + dircount*sizeof (TIFFDirEntry) > tif->tif_size) { - TIFFError(tif->tif_name, "Can not read TIFF private subdirectory"); + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Can not read TIFF private subdirectory"); goto bad; } else _TIFFmemcpy(dir, tif->tif_base + off, @@ -338,7 +338,7 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount) static void MissingRequired(TIFF* tif, const char* tagname) { - TIFFError(tif->tif_name, + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "TIFF directory is missing required \"%s\" field", tagname); } @@ -402,7 +402,7 @@ TIFFFetchData(TIFF* tif, TIFFDirEntry* dir, char* cp) } return (cc); bad: - TIFFError(tif->tif_name, "Error fetching data for field \"%s\"", + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error fetching data for field \"%s\"", _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); return ((tsize_t) 0); } @@ -430,7 +430,7 @@ static int cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32 num, uint32 denom, float* rv) { if (denom == 0) { - TIFFError(tif->tif_name, + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%s: Rational with zero denominator (num = %lu)", _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name, num); return (0); @@ -719,7 +719,7 @@ TIFFFetchAnyArray(TIFF* tif, TIFFDirEntry* dir, double* v) /* TIFF_NOTYPE */ /* TIFF_ASCII */ /* TIFF_UNDEFINED */ - TIFFError(tif->tif_name, + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Cannot read TIFF_ANY type %d for field \"%s\"", _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); return (0); @@ -897,7 +897,7 @@ TIFFFetchPerSampleShorts(TIFF* tif, TIFFDirEntry* dir, int* pl) int i; for (i = 1; i < samples; i++) if (v[i] != v[0]) { - TIFFError(tif->tif_name, + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Cannot handle different per-sample values for field \"%s\"", _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); goto bad; @@ -933,7 +933,7 @@ TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* pl) int i; for (i = 1; i < samples; i++) if (v[i] != v[0]) { - TIFFError(tif->tif_name, + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Cannot handle different per-sample values for field \"%s\"", _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); goto bad; diff --git a/contrib/pds/tif_pdsdirwrite.c b/contrib/pds/tif_pdsdirwrite.c index b0465dad..bc548c4d 100644 --- a/contrib/pds/tif_pdsdirwrite.c +++ b/contrib/pds/tif_pdsdirwrite.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_pdsdirwrite.c,v 1.2 2003-11-17 15:09:39 dron Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_pdsdirwrite.c,v 1.3 2005-12-21 12:23:13 joris Exp $ */ /* When writing data to TIFF files, it is often useful to store application- specific data in a private TIFF directory so that the tags don't need to @@ -177,7 +177,7 @@ TIFFWritePrivateDataSubDirectory(TIFF* tif, dirsize = nfields * sizeof (TIFFDirEntry); data = (char*) _TIFFmalloc(dirsize); if (data == NULL) { - TIFFError(tif->tif_name, + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Cannot write private subdirectory, out of space"); return (0); } @@ -270,15 +270,15 @@ TIFFWritePrivateDataSubDirectory(TIFF* tif, (void) TIFFSeekFile(tif, tif->tif_dataoff, SEEK_SET); if (!WriteOK(tif, &dircount, sizeof (dircount))) { - TIFFError(tif->tif_name, "Error writing private subdirectory count"); + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing private subdirectory count"); goto bad; } if (!WriteOK(tif, data, dirsize)) { - TIFFError(tif->tif_name, "Error writing private subdirectory contents"); + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing private subdirectory contents"); goto bad; } if (!WriteOK(tif, &nextdiroff, sizeof (nextdiroff))) { - TIFFError(tif->tif_name, "Error writing private subdirectory link"); + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing private subdirectory link"); goto bad; } tif->tif_dataoff += sizeof(dircount) + dirsize + sizeof(nextdiroff); @@ -878,7 +878,7 @@ TIFFWriteData(TIFF* tif, TIFFDirEntry* dir, char* cp) tif->tif_dataoff += (cc + 1) & ~1; return (1); } - TIFFError(tif->tif_name, "Error writing data for field \"%s\"", + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing data for field \"%s\"", _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); return (0); } @@ -902,7 +902,7 @@ TIFFLinkDirectory(TIFF* tif) if (tif->tif_flags & TIFF_INSUBIFD) { (void) TIFFSeekFile(tif, tif->tif_subifdoff, SEEK_SET); if (!WriteOK(tif, &diroff, sizeof (diroff))) { - TIFFError(module, + TIFFErrorExt(tif->tif_clientdata, module, "%s: Error writing SubIFD directory link", tif->tif_name); return (0); @@ -927,7 +927,7 @@ TIFFLinkDirectory(TIFF* tif) #define HDROFF(f) ((toff_t) &(((TIFFHeader*) 0)->f)) (void) TIFFSeekFile(tif, HDROFF(tiff_diroff), SEEK_SET); if (!WriteOK(tif, &diroff, sizeof (diroff))) { - TIFFError(tif->tif_name, "Error writing TIFF header"); + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing TIFF header"); return (0); } return (1); @@ -941,7 +941,7 @@ TIFFLinkDirectory(TIFF* tif) if (!SeekOK(tif, nextdir) || !ReadOK(tif, &dircount, sizeof (dircount))) { - TIFFError(module, "Error fetching directory count"); + TIFFErrorExt(tif->tif_clientdata, module, "Error fetching directory count"); return (0); } if (tif->tif_flags & TIFF_SWAB) @@ -949,7 +949,7 @@ TIFFLinkDirectory(TIFF* tif) (void) TIFFSeekFile(tif, dircount * sizeof (TIFFDirEntry), SEEK_CUR); if (!ReadOK(tif, &nextdir, sizeof (nextdir))) { - TIFFError(module, "Error fetching directory link"); + TIFFErrorExt(tif->tif_clientdata, module, "Error fetching directory link"); return (0); } if (tif->tif_flags & TIFF_SWAB) @@ -957,7 +957,7 @@ TIFFLinkDirectory(TIFF* tif) } while (nextdir != 0); (void) TIFFSeekFile(tif, -(toff_t) sizeof (nextdir), SEEK_CUR); if (!WriteOK(tif, &diroff, sizeof (diroff))) { - TIFFError(module, "Error writing directory link"); + TIFFErrorExt(tif->tif_clientdata, module, "Error writing directory link"); return (0); } return (1); diff --git a/contrib/tags/maketif.c b/contrib/tags/maketif.c index aad6f153..99a9ef03 100644 --- a/contrib/tags/maketif.c +++ b/contrib/tags/maketif.c @@ -62,7 +62,7 @@ void WriteImage(TIFF *tif) memset(buffer,0,sizeof(buffer)); for (i=0;i<HEIGHT;i++) if (!TIFFWriteScanline(tif, buffer, i, 0)) - TIFFError("WriteImage","failure in WriteScanline\n"); + TIFFErrorExt(tif->tif_clientdata, "WriteImage","failure in WriteScanline\n"); } diff --git a/contrib/tags/xtif_dir.c b/contrib/tags/xtif_dir.c index c9137aac..7b9ef915 100644 --- a/contrib/tags/xtif_dir.c +++ b/contrib/tags/xtif_dir.c @@ -138,12 +138,12 @@ _XTIFFVSetField(TIFF* tif, ttag_t tag, va_list ap) va_end(ap); return (status); badvalue: - TIFFError(tif->tif_name, "%d: Bad value for \"%s\"", v, + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%d: Bad value for \"%s\"", v, _TIFFFieldWithTag(tif, tag)->field_name); va_end(ap); return (0); badvalue32: - TIFFError(tif->tif_name, "%ld: Bad value for \"%s\"", v32, + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%ld: Bad value for \"%s\"", v32, _TIFFFieldWithTag(tif, tag)->field_name); va_end(ap); return (0); diff --git a/contrib/win_dib/Tiffile.cpp b/contrib/win_dib/Tiffile.cpp index 0c14416c..6e371d3d 100644 --- a/contrib/win_dib/Tiffile.cpp +++ b/contrib/win_dib/Tiffile.cpp @@ -410,7 +410,7 @@ getStripContig1Bit(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) buf = (u_char*) _TIFFmalloc(TIFFStripSize(tif)); if (buf == 0) { - TIFFError(TIFFFileName(tif), "No space for strip buffer"); + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer"); return (0); } y = setorientation(img, h); |