diff options
Diffstat (limited to 'libtiff/tif_dirinfo.c')
-rw-r--r-- | libtiff/tif_dirinfo.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c index c4584647..9b716c2a 100644 --- a/libtiff/tif_dirinfo.c +++ b/libtiff/tif_dirinfo.c @@ -1,8 +1,8 @@ -/* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dirinfo.c,v 1.40 1996/12/13 05:25:39 sam Exp $ */ +/* $Header: /d1/sam/tiff/libtiff/RCS/tif_dirinfo.c,v 1.43 1997/08/29 21:45:48 sam Exp $ */ /* - * Copyright (c) 1988-1996 Sam Leffler - * Copyright (c) 1991-1996 Silicon Graphics, Inc. + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided @@ -220,6 +220,8 @@ static const TIFFFieldInfo tiffFieldInfo[] = { { TIFFTAG_ICCPROFILE, -1,-3, TIFF_UNDEFINED, FIELD_ICCPROFILE, FALSE, TRUE, "ICC Profile" }, #endif + { TIFFTAG_STONITS, 1, 1, TIFF_DOUBLE, FIELD_STONITS, + FALSE, FALSE, "StoNits" }, }; #define N(a) (sizeof (a) / sizeof (a[0])) @@ -238,9 +240,11 @@ tagCompare(const void* a, const void* b) { const TIFFFieldInfo* ta = *(const TIFFFieldInfo**) a; const TIFFFieldInfo* tb = *(const TIFFFieldInfo**) b; - /* NB: width of c must match ttag_t */ - int32 c = ta->field_tag - tb->field_tag; - return (c != 0 ? c : tb->field_type - ta->field_type); + /* NB: be careful of return values for 16-bit platforms */ + if (ta->field_tag != tb->field_tag) + return (ta->field_tag < tb->field_tag ? -1 : 1); + else + return (tb->field_type < ta->field_type ? -1 : 1); } void @@ -278,9 +282,9 @@ _TIFFPrintFieldInfo(TIFF* tif, FILE* fd) fprintf(fd, "%s: \n", tif->tif_name); for (i = 0; i < tif->tif_nfields; i++) { const TIFFFieldInfo* fip = tif->tif_fieldinfo[i]; - fprintf(fd, "field[%2d] %5u, %2d, %2d, %d, %2d, %5s, %5s, %s\n" + fprintf(fd, "field[%2d] %5lu, %2d, %2d, %d, %2d, %5s, %5s, %s\n" , i - , fip->field_tag + , (unsigned long) fip->field_tag , fip->field_readcount, fip->field_writecount , fip->field_type , fip->field_bit |