AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
September 2009

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



2009.09.21 14:41 "How to read extended tags with LibTiffDelphi in Delphi 7", by Ivan Micetic

Dear all,

I am trying to read extended tags from a tiff file in Delphi 7 and I
tried to implement it from a C code snippet found in the mailing list
but with no luck. I have tried something like the following but it has
errors:

...
const
  TIFFTAG_ASCIITAG=34682;
...
procedure TForm1.Button1Click(Sender: TObject);
var
  TestStr:string;
  xtiffFieldInfo:PTIFFFieldInfo;
  OpenTiff: PTIFF;

procedure TagExtender(Handle: PTIFF);
begin
  New(xtiffFieldInfo);
  xtiffFieldInfo^.FieldTag:=TIFFTAG_ASCIITAG;
  xtiffFieldInfo^.FieldReadCount:=-1;
  xtiffFieldInfo^.FieldWriteCount:=-1;
  xtiffFieldInfo^.FieldType:=TIFF_ASCII;
  xtiffFieldInfo^.FieldBit:=FIELD_CUSTOM;
  xtiffFieldInfo^.FieldOkToChange:=1;
  xtiffFieldInfo^.FieldPassCount:=0;
  xtiffFieldInfo^.FieldName:='MyTag';
  TIFFMergeFieldInfo(Handle,xtiffFieldInfo,1);
end;

begin
  TIFFSetTagExtender(@TagExtender);
  OpenTiff:=TIFFOpen('file.tif','r');
  TIFFGetField(OpenTiff,TIFFTAG_ASCIITAG,@TestStr);
  Label1.Caption:='>>>'+TestStr+'<<<';
end;

Could somebody let me know how to read/write an extended ascii and
other type of tags in Delphi?
Thank you in advance,

Ivan Micetic