Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx-j.one.com (mx-j.one.com [91.198.169.57])
	by mail6.b-one.net (Postfix) with ESMTP id 5AA9C8015308B
	for <filtered@awaresystems.be>; Fri, 27 Jul 2012 05:47:14 +0200 (CEST)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx-j: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.220.176 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176])
	by mx-j.one.com (Postfix) with ESMTP id B723143A4FE8
	for <filtered@awaresystems.be>; Fri, 27 Jul 2012 03:47:13 +0000 (UTC)
Received: by vcbfl11 with SMTP id fl11so2982141vcb.21
        for <filtered@awaresystems.be>; Thu, 26 Jul 2012 20:47:12 -0700 (PDT)
Received: by 10.52.93.10 with SMTP id cq10mr869801vdb.122.1343360832830;
        Thu, 26 Jul 2012 20:47:12 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.58.208.231 with SMTP id mh7csp14653vec;
        Thu, 26 Jul 2012 20:47:12 -0700 (PDT)
Received: by 10.52.24.227 with SMTP id x3mr943782vdf.68.1343360831437;
        Thu, 26 Jul 2012 20:47:11 -0700 (PDT)
Received-SPF: neutral (google.com: 91.198.169.250 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=91.198.169.250;
Received: by 10.220.20.139 with POP3 id f11mf2189655vcb.37;
        Thu, 26 Jul 2012 20:47:11 -0700 (PDT)
X-Gmail-Fetch-Info: info@awaresystems.be 1 pop.awaresystems.be 110 info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-s.one.com (mx-s.one.com [91.198.169.250])
	by mail6.b-one.net (Postfix) with ESMTP id 1F7DB8015308B
	for <info@awaresystems.be>; Fri, 27 Jul 2012 05:41:25 +0200 (CEST)
X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx-s.one.com (Postfix) with ESMTP id 68A4C1CFFA15
	for <info@awaresystems.be>; Fri, 27 Jul 2012 03:41:24 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 386413AD9BE;
	Thu, 26 Jul 2012 22:39:54 -0500 (EST)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130])
	by lists.maptools.org (Postfix) with ESMTP id C3BA03AD9BE
	for <tiff@lists.maptools.org>; Thu, 26 Jul 2012 22:34:12 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
	by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q6R3YBBJ023045;
	Thu, 26 Jul 2012 23:34:12 -0400 (EDT)
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
In-reply-to: <alpine.GSO.2.01.1207261510530.21675@freddy.simplesystems.org>
References: <9467.1343271021@sss.pgh.pa.us>
	<alpine.GSO.2.01.1207252202060.27589@freddy.simplesystems.org>
	<16369.1343331785@sss.pgh.pa.us>
	<alpine.GSO.2.01.1207261510530.21675@freddy.simplesystems.org>
Comments: In-reply-to Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
	message dated "Thu, 26 Jul 2012 15:18:19 -0500"
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
Content-ID: <23015.1343359966.0@sss.pgh.pa.us>
Date: Thu, 26 Jul 2012 23:34:11 -0400
Message-ID: <23044.1343360051@sss.pgh.pa.us>
Cc: tiff@lists.maptools.org
Subject: Re: [Tiff] Confused about 4.0 API changes: TIFFField vs
	TIFFFieldInfo
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <23015.1343359966.1@sss.pgh.pa.us>

Bob Friesenhahn <bfriesen@simple.dallas.tx.us> writes:
> On Thu, 26 Jul 2012, Tom Lane wrote:
>> So I propose we add five trivial accessor functions:
>> 
>> int TIFFFieldReadCount(const TIFFField*);
>> int TIFFFieldWriteCount(const TIFFField*);
>> TIFFDataType TIFFFieldDataType(const TIFFField*);
>> int TIFFFieldPassCount(const TIFFField*);
>> const char* TIFFFieldName(const TIFFField*);
>> 
>> that just fetch the indicated field (and, probably, dump core if passed
>> a NULL pointer - is there use in something more complex?)

> These look good to me.

Attached is a draft patch for this.  Aside from adding the functions
themselves, as a test case I converted tiffset.c to use these functions
and not have to pry into any library-private headers.  That led me to
also expose a TIFFFieldTag() function that returns the tag value.
(This seems useful and symmetric given that we have both
TIFFFieldWithTag and TIFFFieldWithName: it seems proper to be able to
get the tag number after a lookup by name, or vice versa.)

I've never added functions to libtiff before, so it'd be good if someone
would review this and see if I missed anything.  In particular, I did
not touch html/man/ since those files look like they are automatically
generated from man/ ... is that correct?  (Also, my groff-fu sucks, so
comments on the man pages would be useful.)

			regards, tom lane


------- =_aaaaaaaaaa0
Content-Type: text/x-patch; charset="us-ascii"
Content-ID: <23015.1343359966.2@sss.pgh.pa.us>
Content-Description: TIFFField-accessors.patch
Content-Transfer-Encoding: quoted-printable

Index: ChangeLog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/maptools/cvsroot/libtiff/ChangeLog,v
retrieving revision 1.915
diff -c -r1.915 ChangeLog
*** ChangeLog	19 Jul 2012 15:43:41 -0000	1.915
--- ChangeLog	27 Jul 2012 03:20:05 -0000
***************
*** 1,3 ****
--- 1,13 ----
+ 2012-07-26  Tom Lane  <tgl@sss.pgh.pa.us>
+ =

+ 	* libtiff/{tiffio.h, tif_dirinfo.c, libtiff.def}: Add six new
+  	functions TIFFFieldTag(), TIFFFieldName(), TIFFFieldDataType(),
+ 	TIFFFieldPassCount(), TIFFFieldReadCount(), TIFFFieldWriteCount()
+ 	as external accessors for the opaque type TIFFField.
+ =

+ 	* tools/tiffset.c: Make tiffset use the above functions instead of
+ 	relying on library private headers.
+ =

  2012-07-19  Tom Lane  <tgl@sss.pgh.pa.us>
  =

  	* tools/tiff2pdf.c: Fix two places where t2p_error didn't get set
Index: configure.com
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/maptools/cvsroot/libtiff/configure.com,v
retrieving revision 1.2
diff -c -r1.2 configure.com
*** configure.com	23 Nov 2007 10:01:34 -0000	1.2
--- configure.com	27 Jul 2012 03:20:05 -0000
***************
*** 503,508 ****
--- 503,514 ----
  TIFFFindFieldInfoByName=3DPROCEDURE,-
  TIFFFieldWithName=3DPROCEDURE,-
  TIFFFieldWithTag=3DPROCEDURE,-
+ TIFFFieldTag=3DPROCEDURE,-
+ TIFFFieldName=3DPROCEDURE,-
+ TIFFFieldDataType=3DPROCEDURE,-
+ TIFFFieldPassCount=3DPROCEDURE,-
+ TIFFFieldReadCount=3DPROCEDURE,-
+ TIFFFieldWriteCount=3DPROCEDURE,-
  TIFFCurrentDirOffset=3DPROCEDURE,-
  TIFFWriteCheck=3DPROCEDURE,-
  TIFFRGBAImageOK=3DPROCEDURE,-
***************
*** 648,653 ****
--- 654,665 ----
  UNIVERSAL=3DTIFFFindFieldInfoByName
  UNIVERSAL=3DTIFFFieldWithName
  UNIVERSAL=3DTIFFFieldWithTag
+ UNIVERSAL=3DTIFFFieldTag
+ UNIVERSAL=3DTIFFFieldName
+ UNIVERSAL=3DTIFFFieldDataType
+ UNIVERSAL=3DTIFFFieldPassCount
+ UNIVERSAL=3DTIFFFieldReadCount
+ UNIVERSAL=3DTIFFFieldWriteCount
  UNIVERSAL=3DTIFFCurrentDirOffset
  UNIVERSAL=3DTIFFWriteCheck
  UNIVERSAL=3DTIFFRGBAImageOK
Index: libtiff/libtiff.def
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/maptools/cvsroot/libtiff/libtiff/libtiff.def,v
retrieving revision 1.33
diff -c -r1.33 libtiff.def
*** libtiff/libtiff.def	16 Jun 2012 17:07:53 -0000	1.33
--- libtiff/libtiff.def	27 Jul 2012 03:20:05 -0000
***************
*** 119,124 ****
--- 119,130 ----
  	TIFFSetTagExtender
  	TIFFFieldWithName
  	TIFFFieldWithTag
+ 	TIFFFieldTag
+ 	TIFFFieldName
+ 	TIFFFieldDataType
+ 	TIFFFieldPassCount
+ 	TIFFFieldReadCount
+ 	TIFFFieldWriteCount
  	TIFFCurrentDirOffset
  	TIFFWriteCheck
  	TIFFRGBAImageOK
Index: libtiff/tif_dirinfo.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dirinfo.c,v
retrieving revision 1.115
diff -c -r1.115 tif_dirinfo.c
*** libtiff/tif_dirinfo.c	6 Jul 2012 19:18:31 -0000	1.115
--- libtiff/tif_dirinfo.c	27 Jul 2012 03:20:05 -0000
***************
*** 556,561 ****
--- 556,597 ----
  	return (fip);
  }
  =

+ uint32
+ TIFFFieldTag(const TIFFField* fip)
+ {
+ 	return fip->field_tag;
+ }
+ =

+ const char *
+ TIFFFieldName(const TIFFField* fip)
+ {
+ 	return fip->field_name;
+ }
+ =

+ TIFFDataType
+ TIFFFieldDataType(const TIFFField* fip)
+ {
+ 	return fip->field_type;
+ }
+ =

+ int
+ TIFFFieldPassCount(const TIFFField* fip)
+ {
+ 	return fip->field_passcount;
+ }
+ =

+ int
+ TIFFFieldReadCount(const TIFFField* fip)
+ {
+ 	return fip->field_readcount;
+ }
+ =

+ int
+ TIFFFieldWriteCount(const TIFFField* fip)
+ {
+ 	return fip->field_writecount;
+ }
+ =

  const TIFFField*
  _TIFFFindOrRegisterField(TIFF *tif, uint32 tag, TIFFDataType dt)
  =

Index: libtiff/tiffio.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/maptools/cvsroot/libtiff/libtiff/tiffio.h,v
retrieving revision 1.90
diff -c -r1.90 tiffio.h
*** libtiff/tiffio.h	6 Jun 2012 04:58:00 -0000	1.90
--- libtiff/tiffio.h	27 Jul 2012 03:20:05 -0000
***************
*** 319,324 ****
--- 319,331 ----
  extern const TIFFField* TIFFFieldWithTag(TIFF*, uint32);
  extern const TIFFField* TIFFFieldWithName(TIFF*, const char *);
  =

+ extern uint32 TIFFFieldTag(const TIFFField*);
+ extern const char* TIFFFieldName(const TIFFField*);
+ extern TIFFDataType TIFFFieldDataType(const TIFFField*);
+ extern int TIFFFieldPassCount(const TIFFField*);
+ extern int TIFFFieldReadCount(const TIFFField*);
+ extern int TIFFFieldWriteCount(const TIFFField*);
+ =

  typedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list);
  typedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list);
  typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);
Index: man/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/maptools/cvsroot/libtiff/man/Makefile.am,v
retrieving revision 1.8
diff -c -r1.8 Makefile.am
*** man/Makefile.am	24 Feb 2007 15:03:51 -0000	1.8
--- man/Makefile.am	27 Jul 2012 03:20:05 -0000
***************
*** 59,64 ****
--- 59,73 ----
  	TIFFcolor.3tiff \
  	TIFFDataWidth.3tiff \
  	TIFFError.3tiff \
+ 	TIFFFieldDataType.3tiff \
+ 	TIFFFieldName.3tiff \
+ 	TIFFFieldPassCount.3tiff \
+ 	TIFFFieldReadCount.3tiff \
+ 	TIFFFieldTag.3tiff \
+ 	TIFFFieldWithName.3tiff \
+ 	TIFFFieldWithTag.3tiff \
+ 	TIFFFieldWriteCount.3tiff \
+ 	TIFFFindField.3tiff \
  	TIFFFlush.3tiff \
  	TIFFGetField.3tiff \
  	TIFFmemory.3tiff \
Index: man/libtiff.3tiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/maptools/cvsroot/libtiff/man/libtiff.3tiff,v
retrieving revision 1.3
diff -c -r1.3 libtiff.3tiff
*** man/libtiff.3tiff	2 Nov 2005 11:07:19 -0000	1.3
--- man/libtiff.3tiff	27 Jul 2012 03:20:05 -0000
***************
*** 163,171 ****
--- 163,180 ----
  TIFFDataWidth 		return the size of TIFF data types
  TIFFError		library error handler
  TIFFFdOpen		open a file for reading or writing
+ TIFFFieldDataType	get data type from field information
+ TIFFFieldName		get field name from field information
+ TIFFFieldPassCount	get whether to pass a value count to Get/SetField
+ TIFFFieldReadCount	get number of values to be read from field
+ TIFFFieldTag		get tag value from field information
+ TIFFFieldWithName	get field information given field name
+ TIFFFieldWithTag	get field information given tag
+ TIFFFieldWriteCount	get number of values to be written to field
  TIFFFileName		return name of open file
  TIFFFileno		return open file descriptor
  TIFFFindCODEC		find standard codec for the specific scheme
+ TIFFFindField		get field information given tag and data type
  TIFFFlush		flush all pending writes
  TIFFFlushData		flush pending data writes
  TIFFGetBitRevTable	return bit reversal table
Index: tools/tiffset.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/maptools/cvsroot/libtiff/tools/tiffset.c,v
retrieving revision 1.16
diff -c -r1.16 tiffset.c
*** tools/tiffset.c	26 Mar 2011 12:07:20 -0000	1.16
--- tools/tiffset.c	27 Jul 2012 03:20:05 -0000
***************
*** 35,41 ****
  #include <stdlib.h>
  =

  #include "tiffio.h"
- #include "tif_dir.h"
  =

  static char* usageMsg[] =3D {
  "usage: tiffset [options] filename",
--- 35,40 ----
***************
*** 118,142 ****
                  return 3;
  =

              arg_index++;
!             if (fip->field_type =3D=3D TIFF_ASCII) {
!                 if (TIFFSetField(tiff, fip->field_tag, argv[arg_index]) =
!=3D 1)
                      fprintf( stderr, "Failed to set %s=3D%s\n",
!                              fip->field_name, argv[arg_index] );
!             } else if (fip->field_writecount > 0
! 		       || fip->field_writecount =3D=3D TIFF_VARIABLE) {
                  int     ret =3D 1;
                  short   wc;
  =

!                 if (fip->field_writecount =3D=3D TIFF_VARIABLE)
                          wc =3D atoi(argv[arg_index++]);
                  else
!                         wc =3D fip->field_writecount;
  =

                  if (argc - arg_index < wc) {
                      fprintf( stderr,
                               "Number of tag values is not enough. "
                               "Expected %d values for %s tag, got %d\n",
!                              wc, fip->field_name, argc - arg_index);
                      return 4;
                  }
                      =

--- 117,141 ----
                  return 3;
  =

              arg_index++;
!             if (TIFFFieldDataType(fip) =3D=3D TIFF_ASCII) {
!                 if (TIFFSetField(tiff, TIFFFieldTag(fip), argv[arg_index=
]) !=3D 1)
                      fprintf( stderr, "Failed to set %s=3D%s\n",
!                              TIFFFieldName(fip), argv[arg_index] );
!             } else if (TIFFFieldWriteCount(fip) > 0
! 		       || TIFFFieldWriteCount(fip) =3D=3D TIFF_VARIABLE) {
                  int     ret =3D 1;
                  short   wc;
  =

!                 if (TIFFFieldWriteCount(fip) =3D=3D TIFF_VARIABLE)
                          wc =3D atoi(argv[arg_index++]);
                  else
!                         wc =3D TIFFFieldWriteCount(fip);
  =

                  if (argc - arg_index < wc) {
                      fprintf( stderr,
                               "Number of tag values is not enough. "
                               "Expected %d values for %s tag, got %d\n",
!                              wc, TIFFFieldName(fip), argc - arg_index);
                      return 4;
                  }
                      =

***************
*** 144,150 ****
                          int     i, size;
                          void    *array;
  =

!                         switch (fip->field_type) {
                                  /*
                                   * XXX: We can't use TIFFDataWidth()
                                   * to determine the space needed to stor=
e
--- 143,149 ----
                          int     i, size;
                          void    *array;
  =

!                         switch (TIFFFieldDataType(fip)) {
                                  /*
                                   * XXX: We can't use TIFFDataWidth()
                                   * to determine the space needed to stor=
e
***************
*** 186,192 ****
                                  return 4;
                          }
  =

!                         switch (fip->field_type) {
                              case TIFF_BYTE:
                                  for (i =3D 0; i < wc; i++)
                                      ((uint8 *)array)[i] =3D atoi(argv[ar=
g_index+i]);
--- 185,191 ----
                                  return 4;
                          }
  =

!                         switch (TIFFFieldDataType(fip)) {
                              case TIFF_BYTE:
                                  for (i =3D 0; i < wc; i++)
                                      ((uint8 *)array)[i] =3D atoi(argv[ar=
g_index+i]);
***************
*** 226,274 ****
                                  break;
                          }
                  =

!                         if (fip->field_passcount) {
!                                 ret =3D TIFFSetField(tiff, fip->field_ta=
g,
                                                     wc, array);
!                         } else if (fip->field_tag =3D=3D TIFFTAG_PAGENUM=
BER
! 				   || fip->field_tag =3D=3D TIFFTAG_HALFTONEHINTS
! 				   || fip->field_tag =3D=3D TIFFTAG_YCBCRSUBSAMPLING
! 				   || fip->field_tag =3D=3D TIFFTAG_DOTRANGE) {
!        				if (fip->field_type =3D=3D TIFF_BYTE) {
! 					ret =3D TIFFSetField(tiff, fip->field_tag,
  						((uint8 *)array)[0], ((uint8 *)array)[1]);
! 				} else if (fip->field_type =3D=3D TIFF_SHORT) {
! 					ret =3D TIFFSetField(tiff, fip->field_tag,
  						((uint16 *)array)[0], ((uint16 *)array)[1]);
  				}
  			} else {
!                                 ret =3D TIFFSetField(tiff, fip->field_ta=
g,
                                                     array);
                          }
  =

                          _TIFFfree(array);
                  } else {
!                         switch (fip->field_type) {
                              case TIFF_BYTE:
                              case TIFF_SHORT:
                              case TIFF_SBYTE:
                              case TIFF_SSHORT:
!                                 ret =3D TIFFSetField(tiff, fip->field_ta=
g,
                                                     atoi(argv[arg_index++=
]));
                                  break;
                              case TIFF_LONG:
                              case TIFF_SLONG:
                              case TIFF_IFD:
!                                 ret =3D TIFFSetField(tiff, fip->field_ta=
g,
                                                     atol(argv[arg_index++=
]));
                                  break;
                              case TIFF_DOUBLE:
!                                 ret =3D TIFFSetField(tiff, fip->field_ta=
g,
                                                     atof(argv[arg_index++=
]));
                                  break;
                              case TIFF_RATIONAL:
                              case TIFF_SRATIONAL:
                              case TIFF_FLOAT:
!                                 ret =3D TIFFSetField(tiff, fip->field_ta=
g,
                                                     (float)atof(argv[arg_=
index++]));
                                  break;
                              default:
--- 225,273 ----
                                  break;
                          }
                  =

!                         if (TIFFFieldPassCount(fip)) {
!                                 ret =3D TIFFSetField(tiff, TIFFFieldTag(=
fip),
                                                     wc, array);
!                         } else if (TIFFFieldTag(fip) =3D=3D TIFFTAG_PAGE=
NUMBER
! 				   || TIFFFieldTag(fip) =3D=3D TIFFTAG_HALFTONEHINTS
! 				   || TIFFFieldTag(fip) =3D=3D TIFFTAG_YCBCRSUBSAMPLING
! 				   || TIFFFieldTag(fip) =3D=3D TIFFTAG_DOTRANGE) {
!        				if (TIFFFieldDataType(fip) =3D=3D TIFF_BYTE) {
! 					ret =3D TIFFSetField(tiff, TIFFFieldTag(fip),
  						((uint8 *)array)[0], ((uint8 *)array)[1]);
! 				} else if (TIFFFieldDataType(fip) =3D=3D TIFF_SHORT) {
! 					ret =3D TIFFSetField(tiff, TIFFFieldTag(fip),
  						((uint16 *)array)[0], ((uint16 *)array)[1]);
  				}
  			} else {
!                                 ret =3D TIFFSetField(tiff, TIFFFieldTag(=
fip),
                                                     array);
                          }
  =

                          _TIFFfree(array);
                  } else {
!                         switch (TIFFFieldDataType(fip)) {
                              case TIFF_BYTE:
                              case TIFF_SHORT:
                              case TIFF_SBYTE:
                              case TIFF_SSHORT:
!                                 ret =3D TIFFSetField(tiff, TIFFFieldTag(=
fip),
                                                     atoi(argv[arg_index++=
]));
                                  break;
                              case TIFF_LONG:
                              case TIFF_SLONG:
                              case TIFF_IFD:
!                                 ret =3D TIFFSetField(tiff, TIFFFieldTag(=
fip),
                                                     atol(argv[arg_index++=
]));
                                  break;
                              case TIFF_DOUBLE:
!                                 ret =3D TIFFSetField(tiff, TIFFFieldTag(=
fip),
                                                     atof(argv[arg_index++=
]));
                                  break;
                              case TIFF_RATIONAL:
                              case TIFF_SRATIONAL:
                              case TIFF_FLOAT:
!                                 ret =3D TIFFSetField(tiff, TIFFFieldTag(=
fip),
                                                     (float)atof(argv[arg_=
index++]));
                                  break;
                              default:
***************
*** 277,283 ****
                  }
  =

                  if (ret !=3D 1)
!                     fprintf(stderr, "Failed to set %s\n", fip->field_nam=
e);
                  arg_index +=3D wc;
              }
          } else if (strcmp(argv[arg_index],"-sf") =3D=3D 0 && arg_index <=
 argc-3) {
--- 276,282 ----
                  }
  =

                  if (ret !=3D 1)
!                     fprintf(stderr, "Failed to set %s\n", TIFFFieldName(=
fip));
                  arg_index +=3D wc;
              }
          } else if (strcmp(argv[arg_index],"-sf") =3D=3D 0 && arg_index <=
 argc-3) {
***************
*** 292,301 ****
              if (!fip)
                  return 3;
  =

!             if (fip->field_type !=3D TIFF_ASCII) {
                  fprintf( stderr,
                           "Only ASCII tags can be set from file. "
!                          "%s is not ASCII tag.\n", fip->field_name );
                  return 5;
              }
  =

--- 291,300 ----
              if (!fip)
                  return 3;
  =

!             if (TIFFFieldDataType(fip) !=3D TIFF_ASCII) {
                  fprintf( stderr,
                           "Only ASCII tags can be set from file. "
!                          "%s is not ASCII tag.\n", TIFFFieldName(fip) );
                  return 5;
              }
  =

***************
*** 312,320 ****
  =

              fclose( fp );
  =

!             if(TIFFSetField( tiff, fip->field_tag, text ) !=3D 1) {
                  fprintf(stderr, "Failed to set %s from file %s\n", =

!                         fip->field_name, argv[arg_index]);
              }
  =

              _TIFFfree( text );
--- 311,319 ----
  =

              fclose( fp );
  =

!             if(TIFFSetField( tiff, TIFFFieldTag(fip), text ) !=3D 1) {
                  fprintf(stderr, "Failed to set %s from file %s\n", =

!                         TIFFFieldName(fip), argv[arg_index]);
              }
  =

              _TIFFfree( text );
*** man/TIFFFieldDataType.3tiff~	Thu Jul 26 23:00:01 2012
--- man/TIFFFieldDataType.3tiff	Thu Jul 26 22:56:13 2012
***************
*** 0 ****
--- 1,53 ----
+ .\" $Id$
+ .\"
+ .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
+ .\"
+ .\" Permission to use, copy, modify, distribute, and sell this software =
and =

+ .\" its documentation for any purpose is hereby granted without fee, pro=
vided
+ .\" that (i) the above copyright notices and this permission notice appe=
ar in
+ .\" all copies of the software and related documentation, and (ii) the n=
ames of
+ .\" Sam Leffler and Silicon Graphics may not be used in any advertising =
or
+ .\" publicity relating to the software without the specific, prior writt=
en
+ .\" permission of Sam Leffler and Silicon Graphics.
+ .\" =

+ .\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, =

+ .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY =

+ .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  =

+ .\" =

+ .\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ .\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KI=
ND,
+ .\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFIT=
S,
+ .\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEO=
RY OF =

+ .\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMAN=
CE =

+ .\" OF THIS SOFTWARE.
+ .\"
+ .if n .po 0
+ .TH TIFFFieldDataType 3TIFF "July 26, 2012" "libtiff"
+ .SH NAME
+ TIFFFieldDataType \- Get TIFF data type from field information
+ .SH SYNOPSIS
+ .B "#include <tiffio.h>"
+ .sp
+ .BI "TIFFDataType TIFFFieldDataType(const TIFFField* " fip ")"
+ .SH DESCRIPTION
+ .BR TIFFFieldDataType
+ returns the data type stored in a TIFF field.
+ .P
+ .I fip
+ is a field information pointer previously returned by
+ .BR TIFFFindField ,
+ .BR TIFFFieldWithTag ,
+ or
+ .BR TIFFFieldWithName .
+ .br
+ .SH "RETURN VALUES"
+ .br
+ .BR TIFFFieldDataType
+ returns a member of the enum type
+ .BR TIFFDataType .
+ .br
+ .SH "SEE ALSO"
+ .BR libtiff (3TIFF),
+ .PP
+ Libtiff library home page:
+ .BR http://www.remotesensing.org/libtiff/
*** man/TIFFFieldName.3tiff~	Thu Jul 26 23:00:01 2012
--- man/TIFFFieldName.3tiff	Thu Jul 26 22:56:18 2012
***************
*** 0 ****
--- 1,52 ----
+ .\" $Id$
+ .\"
+ .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
+ .\"
+ .\" Permission to use, copy, modify, distribute, and sell this software =
and =

+ .\" its documentation for any purpose is hereby granted without fee, pro=
vided
+ .\" that (i) the above copyright notices and this permission notice appe=
ar in
+ .\" all copies of the software and related documentation, and (ii) the n=
ames of
+ .\" Sam Leffler and Silicon Graphics may not be used in any advertising =
or
+ .\" publicity relating to the software without the specific, prior writt=
en
+ .\" permission of Sam Leffler and Silicon Graphics.
+ .\" =

+ .\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, =

+ .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY =

+ .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  =

+ .\" =

+ .\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ .\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KI=
ND,
+ .\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFIT=
S,
+ .\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEO=
RY OF =

+ .\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMAN=
CE =

+ .\" OF THIS SOFTWARE.
+ .\"
+ .if n .po 0
+ .TH TIFFFieldName 3TIFF "July 26, 2012" "libtiff"
+ .SH NAME
+ TIFFFieldName \- Get TIFF field name from field information
+ .SH SYNOPSIS
+ .B "#include <tiffio.h>"
+ .sp
+ .BI "const char* TIFFFieldName(const TIFFField* " fip ")"
+ .SH DESCRIPTION
+ .BR TIFFFieldName
+ returns the textual name for a TIFF field.
+ .P
+ .I fip
+ is a field information pointer previously returned by
+ .BR TIFFFindField ,
+ .BR TIFFFieldWithTag ,
+ or
+ .BR TIFFFieldWithName .
+ .br
+ .SH "RETURN VALUES"
+ .br
+ .BR TIFFFieldName
+ returns a constant C string.
+ .br
+ .SH "SEE ALSO"
+ .BR libtiff (3TIFF),
+ .PP
+ Libtiff library home page:
+ .BR http://www.remotesensing.org/libtiff/
*** man/TIFFFieldPassCount.3tiff~	Thu Jul 26 23:00:01 2012
--- man/TIFFFieldPassCount.3tiff	Thu Jul 26 22:55:52 2012
***************
*** 0 ****
--- 1,73 ----
+ .\" $Id$
+ .\"
+ .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
+ .\"
+ .\" Permission to use, copy, modify, distribute, and sell this software =
and =

+ .\" its documentation for any purpose is hereby granted without fee, pro=
vided
+ .\" that (i) the above copyright notices and this permission notice appe=
ar in
+ .\" all copies of the software and related documentation, and (ii) the n=
ames of
+ .\" Sam Leffler and Silicon Graphics may not be used in any advertising =
or
+ .\" publicity relating to the software without the specific, prior writt=
en
+ .\" permission of Sam Leffler and Silicon Graphics.
+ .\" =

+ .\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, =

+ .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY =

+ .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  =

+ .\" =

+ .\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ .\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KI=
ND,
+ .\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFIT=
S,
+ .\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEO=
RY OF =

+ .\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMAN=
CE =

+ .\" OF THIS SOFTWARE.
+ .\"
+ .if n .po 0
+ .TH TIFFFieldPassCount 3TIFF "July 26, 2012" "libtiff"
+ .SH NAME
+ TIFFFieldPassCount \- Get whether to pass a count to TIFFGet/SetField
+ .SH SYNOPSIS
+ .B "#include <tiffio.h>"
+ .sp
+ .BI "int TIFFFieldPassCount(const TIFFField* " fip ")"
+ .SH DESCRIPTION
+ .BR TIFFFieldPassCount
+ returns true (nonzero) if
+ .BR TIFFGetField
+ and
+ .BR TIFFSetField
+ expect a
+ .I count
+ value to be passed before the actual data pointer.
+ .P
+ .I fip
+ is a field information pointer previously returned by
+ .BR TIFFFindField ,
+ .BR TIFFFieldWithTag ,
+ or
+ .BR TIFFFieldWithName .
+ .P
+ When a
+ .I count
+ is required, it will be of type
+ .BR uint32
+ when
+ .BR TIFFFieldReadCount
+ reports
+ .BR TIFF_VARIABLE2 ,
+ and of type
+ .BR uint16
+ otherwise.  (This distinction is critical for use of
+ .BR TIFFGetField ,
+ but normally not so for use of
+ .BR TIFFSetField .)
+ .br
+ .SH "RETURN VALUES"
+ .br
+ .BR TIFFFieldPassCount
+ returns an integer that is always 1 (true) or 0 (false).
+ .br
+ .SH "SEE ALSO"
+ .BR libtiff (3TIFF),
+ .PP
+ Libtiff library home page:
+ .BR http://www.remotesensing.org/libtiff/
*** man/TIFFFieldReadCount.3tiff~	Thu Jul 26 23:00:01 2012
--- man/TIFFFieldReadCount.3tiff	Thu Jul 26 22:46:35 2012
***************
*** 0 ****
--- 1,77 ----
+ .\" $Id$
+ .\"
+ .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
+ .\"
+ .\" Permission to use, copy, modify, distribute, and sell this software =
and =

+ .\" its documentation for any purpose is hereby granted without fee, pro=
vided
+ .\" that (i) the above copyright notices and this permission notice appe=
ar in
+ .\" all copies of the software and related documentation, and (ii) the n=
ames of
+ .\" Sam Leffler and Silicon Graphics may not be used in any advertising =
or
+ .\" publicity relating to the software without the specific, prior writt=
en
+ .\" permission of Sam Leffler and Silicon Graphics.
+ .\" =

+ .\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, =

+ .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY =

+ .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  =

+ .\" =

+ .\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ .\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KI=
ND,
+ .\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFIT=
S,
+ .\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEO=
RY OF =

+ .\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMAN=
CE =

+ .\" OF THIS SOFTWARE.
+ .\"
+ .if n .po 0
+ .TH TIFFFieldReadCount 3TIFF "July 26, 2012" "libtiff"
+ .SH NAME
+ TIFFFieldReadCount \- Get number of values to be read from field
+ .SH SYNOPSIS
+ .B "#include <tiffio.h>"
+ .sp
+ .BI "int TIFFFieldReadCount(const TIFFField* " fip ")"
+ .SH DESCRIPTION
+ .BR TIFFFieldReadCount
+ returns the number of values available to be read from the specified
+ TIFF field; that is, the number of arguments that should be supplied to
+ .BR TIFFGetField .
+ For most field types this is a small positive integer, typically 1 or 2,
+ but there are some special values:
+ .br
+ .BR TIFF_VARIABLE
+ indicates that a variable number of values is possible; then, a
+ .BR uint16
+ .I count
+ argument and a pointer
+ .I data
+ argument must be supplied to
+ .BR TIFFGetField .
+ .br
+ .BR TIFF_VARIABLE2
+ is the same as
+ .BR TIFF_VARIABLE
+ except that the
+ .I count
+ argument must have type
+ .BR uint32 .
+ .br
+ .BR TIFF_SPP
+ indicates that the number of arguments is equal to the image's
+ number of samples per pixel.
+ .P
+ .I fip
+ is a field information pointer previously returned by
+ .BR TIFFFindField ,
+ .BR TIFFFieldWithTag ,
+ or
+ .BR TIFFFieldWithName .
+ .br
+ .SH "RETURN VALUES"
+ .br
+ .BR TIFFFieldReadCount
+ returns an integer.
+ .br
+ .SH "SEE ALSO"
+ .BR libtiff (3TIFF),
+ .PP
+ Libtiff library home page:
+ .BR http://www.remotesensing.org/libtiff/
*** man/TIFFFieldTag.3tiff~	Thu Jul 26 23:00:01 2012
--- man/TIFFFieldTag.3tiff	Thu Jul 26 22:56:25 2012
***************
*** 0 ****
--- 1,56 ----
+ .\" $Id$
+ .\"
+ .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
+ .\"
+ .\" Permission to use, copy, modify, distribute, and sell this software =
and =

+ .\" its documentation for any purpose is hereby granted without fee, pro=
vided
+ .\" that (i) the above copyright notices and this permission notice appe=
ar in
+ .\" all copies of the software and related documentation, and (ii) the n=
ames of
+ .\" Sam Leffler and Silicon Graphics may not be used in any advertising =
or
+ .\" publicity relating to the software without the specific, prior writt=
en
+ .\" permission of Sam Leffler and Silicon Graphics.
+ .\" =

+ .\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, =

+ .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY =

+ .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  =

+ .\" =

+ .\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ .\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KI=
ND,
+ .\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFIT=
S,
+ .\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEO=
RY OF =

+ .\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMAN=
CE =

+ .\" OF THIS SOFTWARE.
+ .\"
+ .if n .po 0
+ .TH TIFFFieldTag 3TIFF "July 26, 2012" "libtiff"
+ .SH NAME
+ TIFFFieldTag \- Get TIFF field tag value from field information
+ .SH SYNOPSIS
+ .B "#include <tiffio.h>"
+ .sp
+ .BI "uint32 TIFFFieldTag(const TIFFField* " fip ")"
+ .SH DESCRIPTION
+ .BR TIFFFieldTag
+ returns the numeric tag value for a TIFF field.
+ This can be compared to various constants exported by the
+ .BR libtiff
+ header files, such as
+ .BR TIFFTAG_IMAGEWIDTH .
+ .P
+ .I fip
+ is a field information pointer previously returned by
+ .BR TIFFFindField ,
+ .BR TIFFFieldWithTag ,
+ or
+ .BR TIFFFieldWithName .
+ .br
+ .SH "RETURN VALUES"
+ .br
+ .BR TIFFFieldTag
+ returns an integer tag value.
+ .br
+ .SH "SEE ALSO"
+ .BR libtiff (3TIFF),
+ .PP
+ Libtiff library home page:
+ .BR http://www.remotesensing.org/libtiff/
*** man/TIFFFieldWriteCount.3tiff~	Thu Jul 26 23:00:01 2012
--- man/TIFFFieldWriteCount.3tiff	Thu Jul 26 22:51:27 2012
***************
*** 0 ****
--- 1,88 ----
+ .\" $Id$
+ .\"
+ .\" Copyright (c) 2012, Tom Lane <tgl@sss.pgh.pa.us>
+ .\"
+ .\" Permission to use, copy, modify, distribute, and sell this software =
and =

+ .\" its documentation for any purpose is hereby granted without fee, pro=
vided
+ .\" that (i) the above copyright notices and this permission notice appe=
ar in
+ .\" all copies of the software and related documentation, and (ii) the n=
ames of
+ .\" Sam Leffler and Silicon Graphics may not be used in any advertising =
or
+ .\" publicity relating to the software without the specific, prior writt=
en
+ .\" permission of Sam Leffler and Silicon Graphics.
+ .\" =

+ .\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, =

+ .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY =

+ .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  =

+ .\" =

+ .\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ .\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KI=
ND,
+ .\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFIT=
S,
+ .\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEO=
RY OF =

+ .\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMAN=
CE =

+ .\" OF THIS SOFTWARE.
+ .\"
+ .if n .po 0
+ .TH TIFFFieldWriteCount 3TIFF "July 26, 2012" "libtiff"
+ .SH NAME
+ TIFFFieldWriteCount \- Get number of values to be written to field
+ .SH SYNOPSIS
+ .B "#include <tiffio.h>"
+ .sp
+ .BI "int TIFFFieldWriteCount(const TIFFField* " fip ")"
+ .SH DESCRIPTION
+ .BR TIFFFieldWriteCount
+ returns the number of values to be written into the specified
+ TIFF field; that is, the number of arguments that should be supplied to
+ .BR TIFFSetField .
+ For most field types this is a small positive integer, typically 1 or 2,
+ but there are some special values:
+ .br
+ .BR TIFF_VARIABLE
+ indicates that a variable number of values is possible; then, a
+ .BR uint16
+ .I count
+ argument and a pointer
+ .I data
+ argument must be supplied to
+ .BR TIFFSetField .
+ .br
+ .BR TIFF_VARIABLE2
+ is the same as
+ .BR TIFF_VARIABLE
+ except that the
+ .I count
+ argument must have type
+ .BR uint32 .
+ (On most modern machines, this makes no practical difference, and the
+ .I count
+ argument can simply be an
+ .BR int
+ in either case.)
+ .br
+ .BR TIFF_SPP
+ indicates that the number of arguments must be equal to the image's
+ number of samples per pixel.
+ .P
+ .I fip
+ is a field information pointer previously returned by
+ .BR TIFFFindField ,
+ .BR TIFFFieldWithTag ,
+ or
+ .BR TIFFFieldWithName .
+ .P
+ For most field types,
+ .BR TIFFFieldWriteCount
+ returns the same value as
+ .BR TIFFFieldReadCount ,
+ but there are some exceptions.
+ .br
+ .SH "RETURN VALUES"
+ .br
+ .BR TIFFFieldWriteCount
+ returns an integer.
+ .br
+ .SH "SEE ALSO"
+ .BR libtiff (3TIFF),
+ .PP
+ Libtiff library home page:
+ .BR http://www.remotesensing.org/libtiff/

------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
------- =_aaaaaaaaaa0--
