2005.06.21 09:17 "[Tiff] Tiff-Tags and Delphi7 / X and Y RESOLUTION / PHOTOMETRIC", by Matthias Lach

2005.06.21 11:30 "Re: [Tiff] Tiff-Tags and Delphi7 / X and Y RESOLUTION / PHOTOMETRIC", by Joris Van Damme

So i put a sting "minis" with "PHOTOMETRIC_MINISWHITH" and used

  TIFFSetField(tifbild, TIFFTAG_PHOTOMETRIC, minis);

BUT - that does not work. the outputfile as the value "unknown 26696" as Photometric.

See http://www.remotesensing.org/libtiff/man/TIFFSetField.3tiff.html, you'll learn that string is not the wright datatype. Alternatively, look up PHOTOMETRIC_MINISWHITE in the LibTiffDelphi.pas sources, and you'll learn that it is an integer constant.

var
  minis: Word;
begin
  minis:=PHOTOMETRIC_MINISWHITE
  TIFFSetFied(tifbild,TIFFTAG_PHOTOMETRIC,minis);

Something along those lines should work.

i read

TIFFGetField(OpenTiff,TIFFTAG_XRESOLUTION,@FirstPageXReso)

and

TIFFGetField(OpenTiff,TIFFTAG_YRESOLUTION,@FirstPageYReso),

put it in public variables of cardinal type. i get x= 1129054208 and Y=1128529920 from a file that is x=204 dpi and y= 196 dpi.

Again see the man page, on TIFFGetField this time, http://www.remotesensing.org/libtiff/man/TIFFGetField.3tiff.html. You'll learn that the expected data for the resolution tag is a float*, which is the same as a Delphi pointer to a Single. Try something like this

var
  FirstPageXReso: Single;
begin
  TIFFGetField(OpenTiff,TIFFTAG_XRESOLUTION,@FirstPageXReso);

  TIFFSetField(tifbild, TIFFTAG_XRESOLUTION, FirstPageXReso);
  TIFFSetField(tifbild, TIFFTAG_YRESOLUTION, FirstPageYReso);

For setting, too, Single values will be required.

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html