From 879817ce451686f6b320b9afeb95726212f87225 Mon Sep 17 00:00:00 2001 From: Andrey Kiselev Date: Tue, 23 Sep 2003 06:23:39 +0000 Subject: [PATCH] More fixes for EstimateStripByteCounts(). See http://bugzilla.remotesensing.org/show_bug.cgi?id=358 --- libtiff/tif_dirread.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c index 2bc7a0a2..d1c61a07 100644 --- a/libtiff/tif_dirread.c +++ b/libtiff/tif_dirread.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dirread.c,v 1.20 2003-07-08 16:40:46 warmerda Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dirread.c,v 1.21 2003-09-23 06:23:39 dron Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -238,8 +238,7 @@ TIFFReadDirectory(TIFF* tif) if (dp->tdir_tag < tif->tif_fieldinfo[fix]->field_tag) { if (!diroutoforderwarning) { TIFFWarning(module, - "%.1000s: invalid TIFF directory; " - "tags are not sorted in ascending order", +"%.1000s: invalid TIFF directory; tags are not sorted in ascending order", tif->tif_name); diroutoforderwarning = 1; } @@ -252,7 +251,7 @@ TIFFReadDirectory(TIFF* tif) tif->tif_fieldinfo[fix]->field_tag != dp->tdir_tag) { TIFFWarning(module, - "%.1000s: unknown field with tag %d (0x%x) encountered", + "%.1000s: unknown field with tag %d (0x%x) encountered", tif->tif_name, dp->tdir_tag, dp->tdir_tag); TIFFMergeFieldInfo( tif, @@ -263,6 +262,7 @@ TIFFReadDirectory(TIFF* tif) while (fix < tif->tif_nfields && tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag) fix++; + dp->tdir_tag = IGNORE; } /* * Null out old tags that we ignore. @@ -283,7 +283,7 @@ TIFFReadDirectory(TIFF* tif) if (fix == tif->tif_nfields || fip->field_tag != dp->tdir_tag) { TIFFWarning(module, - "%.1000s: wrong data type %d for \"%s\"; tag ignored", + "%.1000s: wrong data type %d for \"%s\"; tag ignored", tif->tif_name, dp->tdir_type, fip[-1].field_name); goto ignore; } @@ -520,10 +520,10 @@ TIFFReadDirectory(TIFF* tif) goto bad; } TIFFWarning(module, - "%.1000s: TIFF directory is missing required " - "\"%s\" field, calculating from imagelength", - tif->tif_name, - _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); + "%.1000s: TIFF directory is missing required " + "\"%s\" field, calculating from imagelength", + tif->tif_name, + _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); if (EstimateStripByteCounts(tif, dir, dircount) < 0) goto bad; /* @@ -545,8 +545,7 @@ TIFFReadDirectory(TIFF* tif) * strip image. */ TIFFWarning(module, - "%.1000s: Bogus \"%s\" field, ignoring " - "and calculating from imagelength", + "%.1000s: Bogus \"%s\" field, ignoring and calculating from imagelength", tif->tif_name, _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); if(EstimateStripByteCounts(tif, dir, dircount) < 0)