AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2005.05.18 18:17 "[Tiff] Looking for the definitions of (MS Specific?) tags", by Kevin Grover
2005.05.19 02:14 "Re: [Tiff] Looking for the definitions of (MS Specific?) tags", by Joris Van Damme
2005.05.19 13:53 "Re: [Tiff] Looking for the definitions of (MS Specific?) tags [part 1]", by Ulf Zibis
2005.05.19 15:23 "Re: [Tiff] Looking for the definitions of (MS Specific?) tags [part 1]", by Joris Van Damme
2005.05.19 21:16 "Re: [Tiff] Looking for the definitions of (MS Specific?)", by Ulf Zibis
2005.05.19 21:35 "Re: [Tiff] Looking for the definitions of (MS Specific?) tags", by Ulf Zibis
2005.05.19 13:54 "Re: [Tiff] Looking for the definitions of (MS Specific?) tags [part 2]", by Ulf Zibis
2005.05.23 11:33 "Re: [Tiff] (MS Specific?) tags, Hi Kevin", by Ulf Zibis
2005.05.24 09:08 "Re: [Tiff] (MS Specific?) tags, Hi Kevin", by Joris Van Damme

2005.05.19 13:53 "Re: [Tiff] Looking for the definitions of (MS Specific?) tags [part 1]", by Ulf Zibis

Hi Joris, Kevin and all,

the requested MS-tags are not listed in awaresystems directory.

I have explored some new tags, which are used by Microsoft for the faxconsole, which is included in Windows XP. I dissassembled and iterpreted the TIFF-files myself, so I can't guerantee that the values are all right. I added these tags as described in http://www.remotesensing.org/libtiff/addingtags.html. Please refer to the files in the attachment.

I have written these files to extend sfftobmp capabilities. See: http://sfftools.sourceforge.net.

I had some problems because via xtiffiop.h there are only 33 additional tags possible. So I propose to add theese tags to the normal library.

Because the 3 files exceed the limit of 40 kBytes I post them in to parts for the mailing list.

bye

Ulf Zibis

/*
 *  xtiffio.h -- Public interface to Extended TIFF tags
 *
 *    This is a template for defining a client module
 *    which supports tag extensions to the standard libtiff
 *    set. Only portions of the code marked "XXX" need to
 *    be changed to support your tag set.
 *
 *    written by: Niles D. Ritter
 *    new tags for Microsoft faxconsole by: Ulf Zibis <Ulf.Zibis@gmx.de>:
 */

#ifndef __xtiffio_h
#define __xtiffio_h

#include "../tiff/tiffiop.h"

#if defined(__alpha) || (defined(_MIPS_SZLONG) && _MIPS_SZLONG == 64)
typedef long int64;
typedef unsigned long uint64;   /* sizeof (uint64) must == 8 */
#else
typedef __int64 int64;
typedef unsigned __int64 uint64;        /* sizeof (uint64) must == 8 */
#endif

/*
 *  XXX Define your private Tag names and values here
 *      Attention : Maximum is 33 !!!
 */

#define TIFFTAG_MSFAX_CSID                    40001
#define TIFFTAG_MSFAX_TSID                    40002
#define TIFFTAG_MSFAX_DEVICE                  40003
#define TIFFTAG_MSFAX_ROUTINGINFO             40004
#define TIFFTAG_MSFAX_CALLERID                40005
#define TIFFTAG_MSFAX_RECIPIENTNAME           40006
#define TIFFTAG_MSFAX_RECIPIENTFAXNUMBER      40007
/*
#define TIFFTAG_MSFAX_RECIPIENTCOMPANY        40008
#define TIFFTAG_MSFAX_RECIPIENTADDRESS        40009
#define TIFFTAG_MSFAX_RECIPIENTSTREET         40010
#define TIFFTAG_MSFAX_RECIPIENTCITY           40011
#define TIFFTAG_MSFAX_RECIPIENTZIPCODE        40012
#define TIFFTAG_MSFAX_RECIPIENTCOUNTRY        40013
#define TIFFTAG_MSFAX_RECIPIENTTITLE          40014
#define TIFFTAG_MSFAX_RECIPIENTDEPARTMENT     40015
#define TIFFTAG_MSFAX_RECIPIENTOFFICE         40016
#define TIFFTAG_MSFAX_RECIPIENTOFFICEPHONE    40017
#define TIFFTAG_MSFAX_RECIPIENTHOMEPHONE      40018
#define TIFFTAG_MSFAX_RECIPIENT???            40019
#define TIFFTAG_MSFAX_RECIPIENT???            40020
*/
#define TIFFTAG_MSFAX_SENDERNAME              40021
#define TIFFTAG_MSFAX_SENDERFAXNUMBER         40022
/*
#define TIFFTAG_MSFAX_SENDERCOMPANY           40023
#define TIFFTAG_MSFAX_SENDERADDRES            40024
#define TIFFTAG_MSFAX_SENDERSTREET            40025
#define TIFFTAG_MSFAX_SENDERCITY              40026
#define TIFFTAG_MSFAX_SENDERZIPCODE           40027
#define TIFFTAG_MSFAX_SENDERCOUNTRY           40028
#define TIFFTAG_MSFAX_SENDERTITLE             40029
#define TIFFTAG_MSFAX_SENDERDEPARTMENT        40030
#define TIFFTAG_MSFAX_SENDEROFFICE            40031
#define TIFFTAG_MSFAX_SENDEROFFICEPHONE       40032
#define TIFFTAG_MSFAX_SENDERHOMEPHONE         40033
#define TIFFTAG_MSFAX_SENDER???               40034
#define TIFFTAG_MSFAX_SENDER???               40035
*/
#define TIFFTAG_MSFAX_BILLINGCODE             40036
#define TIFFTAG_MSFAX_USERNAME                40037
#define TIFFTAG_MSFAX_40038                   40038
#define TIFFTAG_MSFAX_DOCUMENT                40039
#define TIFFTAG_MSFAX_COVERPAGESUBJECT        40040
#define TIFFTAG_MSFAX_RETRIES                 40041
#define TIFFTAG_MSFAX_PRIORITY                40042
#define         MSFAX_PRIORITY_LOW                0
#define         MSFAX_PRIORITY_NORMAL             1
#define         MSFAX_PRIORITY_HIGH               2
#define TIFFTAG_MSFAX_PARENTJOBID             40043
#define TIFFTAG_MSFAX_SUBMISSIONTIME          40044
#define TIFFTAG_MSFAX_SCHEDULED               40045
#define TIFFTAG_MSFAX_TOTALPAGES              40046
#define TIFFTAG_MSFAX_TYPE                    40047
#define         MSFAX_TYPE_OUT                    2
#define         MSFAX_TYPE_IN                     4
#define TIFFTAG_MSFAX_40048                   40048
#define         MSFAX_40048_DEFAULT             256
#define TIFFTAG_MSFAX_ERRORCODE               40049
#define         MSFAX_ERRORCODE_NONE              0
#define         MSFAX_ERRORCODE_NOCALLACCEPTANCE  9
#define         MSFAX_ERRORCODE_NODIALINGTONE    11
#define         MSFAX_ERRORCODE_UNKNOWNFATAL     12
#define         MSFAX_ERRORCODE_CALLDELAYED      13
#define         MSFAX_ERRORCODE_INCOMPLETE       16
#define         MSFAX_ERRORCODE_COMPLETE         18
#define TIFFTAG_MSFAX_40050                   40050
#define TIFFTAG_MSFAX_STARTTIME               40051
#define TIFFTAG_MSFAX_ENDTIME                 40052
#define TIFFTAG_MSFAX_40053                   40053
#define         MSFAX_40053_DEFAULT               2
/* These tags are not valid, but are provided for example */
//#define TIFFTAG_EXAMPLE_MULTI             61234
//#define TIFFTAG_EXAMPLE_SINGLE            61235
//#define TIFFTAG_EXAMPLE_ASCII             61236

/*
 *  XXX Define Printing method flags. These
 *  flags may be passed in to TIFFPrintDirectory() to
 *  indicate that those particular field values should
 *  be printed out in full, rather than just an indicator
 *  of whether they are present or not.
 */
#define TIFFPRINT_MYMULTIDOUBLES        0x80000000

/**********************************************************************
 *    Nothing below this line should need to be changed by the user.
 **********************************************************************/

#if defined(__cplusplus)
extern "C" {
#endif

extern TIFF* XTIFFOpen(const char* name, const char* mode);
extern TIFF* XTIFFFdOpen(int fd, const char* name, const char* mode);
extern void  XTIFFClose(TIFF *tif);

#if defined(__cplusplus)
}
#endif

#endif /* __xtiffio_h */




/*
 * Private Extended TIFF library interface.
 *
 *  uses private LIBTIFF interface.
 *
 *  The portions of this module marked "XXX" should be
 *  modified to support your tags instead.
 *
 *  written by: Niles D. Ritter
 *  new tags for Microsoft faxconsole by: Ulf Zibis <Ulf.Zibis@gmx.de>:
 *
 */

#ifndef __xtiffiop_h
#define __xtiffiop_h

#include "../tiff/tiffiop.h"
#include "xtiffio.h"

/**********************************************************************
 *               User Configuration
 **********************************************************************/

/* XXX - Define number of your extended tags here */
#define NUM_XFIELD 27
//#define NUM_XFIELD 53 // FIELD_LAST must be increased.
#define XFIELD_BASE (FIELD_LAST-NUM_XFIELD)

/*  XXX - Define your Tag Fields here  */

#define FIELD_MSFAX_CSID               (XFIELD_BASE+0)
#define FIELD_MSFAX_TSID               (XFIELD_BASE+1)
#define FIELD_MSFAX_DEVICE             (XFIELD_BASE+2)
#define FIELD_MSFAX_ROUTINGINFO        (XFIELD_BASE+3)
#define FIELD_MSFAX_CALLERID           (XFIELD_BASE+4)
#define FIELD_MSFAX_RECIPIENTNAME      (XFIELD_BASE+5)
#define FIELD_MSFAX_RECIPIENTFAXNUMBER (XFIELD_BASE+6)
/*
// Only 33 (FIELD_LAST-62) additional tags are possible!
// See FIELD_LAST in tif_dir.h.
// Don't use the following 13 tags without increasing FIELD_LAST:
#define FIELD_MSFAX_40008              (XFIELD_BASE+7)
#define FIELD_MSFAX_40009              (XFIELD_BASE+8)
#define FIELD_MSFAX_40010              (XFIELD_BASE+9)
#define FIELD_MSFAX_40011              (XFIELD_BASE+10)
#define FIELD_MSFAX_40012              (XFIELD_BASE+11)
#define FIELD_MSFAX_40013              (XFIELD_BASE+12)
#define FIELD_MSFAX_40014              (XFIELD_BASE+13)
#define FIELD_MSFAX_40015              (XFIELD_BASE+14)
#define FIELD_MSFAX_40016              (XFIELD_BASE+15)
#define FIELD_MSFAX_40017              (XFIELD_BASE+16)
#define FIELD_MSFAX_40018              (XFIELD_BASE+17)
#define FIELD_MSFAX_40019              (XFIELD_BASE+18)
#define FIELD_MSFAX_40020              (XFIELD_BASE+19)
*/
#define FIELD_MSFAX_SENDERNAME         (XFIELD_BASE+7)
#define FIELD_MSFAX_SENDERFAXNUMBER    (XFIELD_BASE+8)
/*
// Don't use the following 13 tags without increasing FIELD_LAST:
#define FIELD_MSFAX_SENDERCOMPANY      (XFIELD_BASE+22)
#define FIELD_MSFAX_40024              (XFIELD_BASE+23)
#define FIELD_MSFAX_40025              (XFIELD_BASE+24)
#define FIELD_MSFAX_40026              (XFIELD_BASE+25)
#define FIELD_MSFAX_40027              (XFIELD_BASE+26)
#define FIELD_MSFAX_40028              (XFIELD_BASE+27)
#define FIELD_MSFAX_40029              (XFIELD_BASE+28)
#define FIELD_MSFAX_40030              (XFIELD_BASE+29)
#define FIELD_MSFAX_40031              (XFIELD_BASE+30)
#define FIELD_MSFAX_40032              (XFIELD_BASE+31)
#define FIELD_MSFAX_40033              (XFIELD_BASE+32)
#define FIELD_MSFAX_40034              (XFIELD_BASE+33)
#define FIELD_MSFAX_40035              (XFIELD_BASE+34)
*/
#define FIELD_MSFAX_BILLINGCODE        (XFIELD_BASE+9)
#define FIELD_MSFAX_USERNAME           (XFIELD_BASE+10)
#define FIELD_MSFAX_40038              (XFIELD_BASE+11)
#define FIELD_MSFAX_DOCUMENT           (XFIELD_BASE+12)
#define FIELD_MSFAX_COVERPAGESUBJECT   (XFIELD_BASE+13)
#define FIELD_MSFAX_RETRIES            (XFIELD_BASE+14)
#define FIELD_MSFAX_PRIORITY           (XFIELD_BASE+15)
#define FIELD_MSFAX_PARENTJOBID        (XFIELD_BASE+16)
#define FIELD_MSFAX_SUBMISSIONTIME     (XFIELD_BASE+17)
#define FIELD_MSFAX_SCHEDULED          (XFIELD_BASE+18)
#define FIELD_MSFAX_TOTALPAGES         (XFIELD_BASE+19)
#define FIELD_MSFAX_TYPE               (XFIELD_BASE+20)
#define FIELD_MSFAX_40048              (XFIELD_BASE+21)
#define FIELD_MSFAX_ERRORCODE          (XFIELD_BASE+22)
#define FIELD_MSFAX_40050              (XFIELD_BASE+23)
#define FIELD_MSFAX_STARTTIME          (XFIELD_BASE+24)
#define FIELD_MSFAX_ENDTIME            (XFIELD_BASE+25)
#define FIELD_MSFAX_40053              (XFIELD_BASE+26)
//#define       FIELD_EXAMPLE_MULTI            (XFIELD_BASE+0)
//#define       FIELD_EXAMPLE_SINGLE           (XFIELD_BASE+1)
//#define       FIELD_EXAMPLE_ASCII            (XFIELD_BASE+2)


/* XXX - Define Private directory tag structure here */
struct XTIFFDirectory {
        char*      xd_msfax_csid;
        char*      xd_msfax_tsid;
        char*      xd_msfax_device;
  char*      xd_msfax_routinginfo;
        char*      xd_msfax_callerid;
        char*      xd_msfax_recipientname;
        char*      xd_msfax_recipientfaxnumber;
/*
  char*      xd_msfax_40008;
  char*      xd_msfax_40009;
  char*      xd_msfax_40010;
  char*      xd_msfax_40011;
  char*      xd_msfax_40012;
  char*      xd_msfax_40013;
  char*      xd_msfax_40014;
  char*      xd_msfax_40015;
  char*      xd_msfax_40016;
  char*      xd_msfax_40017;
  char*      xd_msfax_40018;
  char*      xd_msfax_40019;
  char*      xd_msfax_40020;
*/
  char*      xd_msfax_sendername;
  char*      xd_msfax_senderfaxnumber;
/*
  char*      xd_msfax_sendercompany;
  char*      xd_msfax_40024;
  char*      xd_msfax_40025;
  char*      xd_msfax_40026;
  char*      xd_msfax_40027;
  char*      xd_msfax_40028;
  char*      xd_msfax_40029;
  char*      xd_msfax_40030;
  char*      xd_msfax_40031;
  char*      xd_msfax_40032;
  char*      xd_msfax_40033;
  char*      xd_msfax_40034;
  char*      xd_msfax_40035;
*/
  char*      xd_msfax_billingcode;
  char*      xd_msfax_username;
  char*      xd_msfax_40038;
        char*      xd_msfax_document;
        char*      xd_msfax_coverpagesubject;
        uint32     xd_msfax_retries;
        uint32     xd_msfax_priority;
        uint64*    xd_msfax_parentjobid;
        FILETIME*  xd_msfax_submissiontime;
        FILETIME*  xd_msfax_scheduled;
        uint32     xd_msfax_totalpages;
        uint32     xd_msfax_type;
        uint32     xd_msfax_40048;
        uint32     xd_msfax_errorcode;
  char*      xd_msfax_40050;
        FILETIME*  xd_msfax_starttime;
        FILETIME*  xd_msfax_endtime;
        uint32     xd_msfax_40053;
//      uint16     xd_num_multi; /* dir-count for the multi tag */
//      double*    xd_example_multi;
//      uint32     xd_example_single;
//      char*      xd_example_ascii;
};
typedef struct XTIFFDirectory XTIFFDirectory;

/**********************************************************************
 *    Nothing below this line should need to be changed by the user.
 **********************************************************************/

struct xtiff {
        TIFF            *xtif_tif;      /* parent TIFF pointer */
        uint32          xtif_flags;
#define       XTIFFP_PRINT   0x00000001
        XTIFFDirectory  xtif_dir;       /* internal rep of current directory */
        TIFFVSetMethod  xtif_vsetfield; /* inherited tag set routine */
        TIFFVGetMethod  xtif_vgetfield; /* inherited tag get routine */
        TIFFPrintMethod xtif_printdir;  /* inherited dir print method */
};
typedef struct xtiff xtiff;


#define PARENT(xt,pmember) ((xt)->xtif_ ## pmember)
#define TIFFMEMBER(tf,pmember) ((tf)->tif_ ## pmember)
#define XTIFFDIR(tif) ((xtiff *)TIFFMEMBER(tif,clientdir))

/* Extended TIFF flags */
#define XTIFF_INITIALIZED 0x80000000

#endif /* __xtiffiop_h */