AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
February 2009

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2009.02.05 18:38 "assertions, and building with DEBUG/NDEBUG", by Frank Warmerdam
2009.02.05 19:04 "Re: assertions, and building with DEBUG/NDEBUG", by Edward Lam
2009.02.05 19:13 "Re: assertions, and building with DEBUG/NDEBUG", by Bob Friesenhahn
2009.02.05 19:26 "Re: assertions, and building with DEBUG/NDEBUG", by Frank Warmerdam
2009.02.05 20:00 "Re: assertions, and building with DEBUG/NDEBUG", by Bob Friesenhahn
2009.02.06 04:39 "Re: assertions, and building with DEBUG/NDEBUG", by Phillip Crews
2009.02.06 16:33 "Re: assertions, and building with DEBUG/NDEBUG", by Bob Friesenhahn
2009.02.06 20:34 "Re: assertions, and building with DEBUG/NDEBUG", by Phillip Crews
2009.02.06 12:17 "Re: assertions, and building with DEBUG/NDEBUG", by <ron@debian.org>
2009.02.06 13:57 "Re: assertions, and building with DEBUG/NDEBUG", by Edward Lam
2009.02.06 17:08 "Re: assertions, and building with DEBUG/NDEBUG", by Bob Friesenhahn
2009.02.06 21:05 "Re: assertions, and building with DEBUG/NDEBUG", by Phillip Crews
2009.02.06 10:07 "Re: assertions, and building with DEBUG/NDEBUG", by Joris Van Damme
2009.02.06 15:05 "Re: assertions, and building with DEBUG/NDEBUG", by Frank Warmerdam
2009.02.06 10:44 "Re: assertions, and building with DEBUG/NDEBUG", by Joris Van Damme
2009.02.06 14:56 "Re: assertions, and building with DEBUG/NDEBUG", by Frank Warmerdam
2009.02.07 10:53 "Re: assertions, and building with DEBUG/NDEBUG", by Joris Van Damme
2009.02.07 14:10 "Re: The OJPEG bug 1996", by Joris Van Damme
2009.02.26 22:44 "Re: assertions, and building with DEBUG/NDEBUG", by Joris Van Damme

2009.02.06 14:56 "Re: assertions, and building with DEBUG/NDEBUG", by Frank Warmerdam

Joris Van Damme (AWare Systems) wrote:
> Frank, folks,
> 
> This is about http://bugzilla.maptools.org/show_bug.cgi?id=1994. I've 
> currently no bugzilla log-in, and/or I forgot about it, so I'll go ahead 
> and abuse the mailing list.

Joris,

I would appreciate it if you could get a bugzilla account, and be
prepared to interact with bugs there.  In the meantime I've appended
your email to the ticket.

> The thing is, since the compression tag is read in the first stage, and 
> flagged IGNORE, the hacky second and third stages aren't supposed to 
> have to deal with it. Thus, a routine like TIFFFetchNormalTag for 
> example, is never called for the compression tag.

In TIFFFetchNormalTag() we have lots of logic like:

	case TIFF_SETGET_UINT16:
		{
			uint16 data;
			assert(fip->field_readcount==1);
			assert(fip->field_passcount==0);
			err=TIFFReadDirEntryShort(tif,dp,&data);
			if (err==TIFFReadDirEntryErrOk)
			{
				if (!TIFFSetField(tif,dp->tdir_tag,data))
					return(0);
			}
		}
		break;

Would it be better to change these assertions to a runtime error
indicating that this tag is not suitable for processing in
TIFFFetchNormalTag(), possibly indicating a corrupt file or
a logic error in libtiff?

This is quite a dirty file so I'm pleased to settle with reasonable
error reports and recovery.

I presume the "fip" description of the tag cannot be made compatible
with TIFFFetchNormalTag for some reason?  It does not *seem* like a
particularly complicated tag to handle generically.  It is currently:

  	{ TIFFTAG_COMPRESSION, -1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, 
TIFF_SETGET_UNDEFINED, FIELD_COMPRESSION, 0, 0, "Compression", NULL },

I a bit lost in aspects of this - particularly the stuff about
set_field_type and get_field_type in the TIFFField structure.

Actually, can't we just set the field_readcount to 1 and then this
definition would work?

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent