[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: [1]2345678910 ]

[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 09:44:11 10/12/04 Tue
Author: Richard Kahn
Subject: Fax related TIFF Tags

I had send Michel 2001 an update for the TIFF implementation giving access to important Fax-related Tags.
It seams that this code was not included in the 2.x Version. So I post here the aditions again. But first some explainations about the content of these additional fields:


The usage of these fields is dependend on support of the generating software, so here only what should be in that fields.

TIFFTAG_FAXSUBADDRESS is used to store so called "dail-through-extensions", numbers dailed after hook-of by the receiver.

TIFFTAG_FAXRECVPARAMS is used to store the e.g. class 2 receive session parameters. It is a encoded bit field containing the following information:
* Vertical Resolution (98 or 198)
* Bit Rate of submission (2400 - 14400)
* Page Width (215, 255, 303, 151 or 107 mm)
* Page Length (297, 364 or unlimited mm)
* G3 Dataformat (1d MR, 2d, 2d MR or 2d MMR)
* Error Correction Mode on Submission (ECM)
* Scantime per Line
Valueable are bit-rate, dataformat (if file was transcoded to G4 compression after receive) and ECM.

TIFFTAG_FAXRECVTIME to store the time of receiving. Together with the content of TIFFTAG_DATETIME you could recover the precise receive time of the fax.

I use it to read and display there infos from TIFFs generated with hylafax, an open-source fax server (<a rel=nofollow target=_blank href="http://www.hylafax.org).">http://www.hylafax.org).</a> It also uses libtiff to generate the TIFF files.

Here the changes:

1. Change definition of TTiffGraphic as follows:

TTiffGraphic = class(TDibGraphic)
FFaxRecvParamsTag : longword;
FFaxRecvTimeTag : longword;
FFaxSubAddress : AnsiString;
// 06.03.2002 rik: informative TIFF Tags for fax (G3 & G4)
property FaxRecvParamsTag : longword read FFaxRecvParamsTag write FFaxRecvParamsTag;
property FaxRecvTimeTag : longword read FFaxRecvTimeTag write FFaxRecvTimeTag;
property FaxSubAddress : AnsiString read FFaxSubAddress write FFaxSubAddress;

2. add the following procedure to EnTifGr:


// 06.03.2002 rik: read a int tag from a tiff file.
// If the tag is not present, 0 is returned
function ReadIntTag( const TiffHandle : TTiffHandle;
const Tag : Word ) : longword;
TIFFGetField(TiffHandle, Tag, result);
result := 0;


3. add following lines at the end of the procedure ReadTags:

// 06.03.2002 rik: informative TIFF Tags for fax (G3 & G4)
TiffGraphic.FFaxSubAddress := ReadPCharTag( TiffHandle, TIFFTAG_FAXSUBADDRESS );
TiffGraphic.FFaxRecvParamsTag := ReadIntTag(TiffHandle, TIFFTAG_FAXRECVPARAMS );
TiffGraphic.FFaxRecvTimeTag := ReadIntTag(TiffHandle, TIFFTAG_FAXRECVTIME );

4. add the following lines at the end of the procedure WriteTags:

// 06.03.2002 rik: informative TIFF Tags for fax (G3 & G4)
if TiffGraphic.FFaxSubAddress <> '' then
TIFFSetPCharField( TiffHandle, TIFFTAG_FAXSUBADDRESS, PChar(TiffGraphic.FFaxSubAddress) );

if TiffGraphic.FFaxRecvParamsTag <> 0 then
TIFFSetIntField(TiffHandle, TIFFTAG_FAXRECVPARAMS, TiffGraphic.FFaxRecvParamsTag);

if TiffGraphic.FFaxRecvTimeTag <> 0 then
TIFFSetIntField(TiffHandle, TIFFTAG_FAXRECVTIME, TiffGraphic.FFaxRecvTimeTag);

5. Add the following lines to the Tag definitions in EnCLib:

// 06.03.2002 rik: informative TIFF Tags for fax (G3 & G4)
TIFFTAG_BADFAXLINES = 326; // lines w/ wrong pixel count
TIFFTAG_CLEANFAXDATA = 327; // regenerated line info
CLEANFAXDATA_CLEAN = 0; // no errors detected
CLEANFAXDATA_REGENERATED = 1; // receiver regenerated lines
CLEANFAXDATA_UNCLEAN = 2; // uncorrected errors exist
TIFFTAG_CONSECUTIVEBADFAXLINES = 328; // max consecutive bad lines
TIFFTAG_FAXRECVPARAMS = 34908; // encoded class 2 ses. parms
TIFFTAG_FAXSUBADDRESS = 34909; // received SubAddr string
TIFFTAG_FAXRECVTIME = 34910; // receive time (secs)

[ Next Thread | Previous Thread | Next Message | Previous Message ]

[ Contact Forum Admin ]

Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.