From: dron@ak4719.spb.edu (Andrey Kiselev)
Date: Sun, 3 Aug 2003 11:23:45 +0400
Subject: [Tiff] RE: Tiff digest, Vol 1 #5 - 1 msg
In-Reply-To: <0E253E40DC78F4499CEDDE9223099F43059F27BB@xcgva040.northgrum.com>
References: <0E253E40DC78F4499CEDDE9223099F43059F27BB@xcgva040.northgrum.com>
Message-ID: <20030803072345.GA11425@ak4719.spb.edu>

On Thu, Jul 31, 2003 at 05:48:15AM -0700, Tiglao, Percy wrote:
> Thank you very much for the sample code.  Do you have any other
> suggestions on how to handle private tag of type "UNDEFINED" without
> modifying libtiff. Type "ASCII" does not work well for my private
> field since my complex structure contains, among other type, several
> null terminated array of characters (strings). Reading of the field
> stops as soon as the first null is encountered.

Percy,

You may consider using one of the two approaches for your structure.

1. Split your data in different tags. For example, if you have 

   struct
   {
       short   iValue;
       double  dfValue;
       char*   pszStr1;
       char*   pszStr2;
   }

   you can define four new tags with appropriate datatypes. Every string
   and every value will go into separate field.

2. Serialize all your data into string value, place this string into tag
   and deserilize when reading.

Using one of this approaches will take you such an advantage that your
additional data could be simply explored with utilities like `tiffdump'.

					Regards,
					Andrey

-- 
Andrey V. Kiselev
Home phone:  +7 812 5274898  ICQ# 26871517

