Return-Path: <tiff-bounces@remotesensing.org>
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx015.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id j5LBV2Om020834
        for <joris.at.lebbeke@skynet.be>; Tue, 21 Jun 2005 13:31:03 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id 57C3E264F01C; Tue, 21 Jun 2005 07:30:33 -0400 (EDT)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from outmx009.isp.belgacom.be (outmx009.isp.belgacom.be
	[195.238.3.4])
	by xserve.flids.com (Postfix) with ESMTP id 81BF8264EFF8
	for <tiff@remotesensing.org>; Tue, 21 Jun 2005 07:30:30 -0400 (EDT)
Received: from outmx009.isp.belgacom.be (localhost [127.0.0.1])
	by outmx009.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with
	ESMTP id j5LBURKc006549
	for <tiff@remotesensing.org>; Tue, 21 Jun 2005 13:30:27 +0200
	(envelope-from <joris.at.lebbeke@skynet.be>)
Received: from dfgrrxsknr4e (182-163.246.81.adsl.skynet.be [81.246.163.182])
	by outmx009.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with SMTP
	id j5LBUOZS006525; Tue, 21 Jun 2005 13:30:24 +0200
	(envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <001601c57654$aafcecc0$b6a3f651@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: "Matthias Lach" <Matthias.Lach@Telefax400.de>, <tiff@remotesensing.org>
References: <200506210920.j5L9KJK32155@dtagbrg1.telefax400.de>
Subject: Re: [Tiff] Tiff-Tags and Delphi7 / X and Y RESOLUTION / PHOTOMETRIC
Date: Tue, 21 Jun 2005 13:30:44 +0200
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Cc: 
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: 000000000023ceae.0000041d
X-MSP-STORE: Tue, 21 Jun 2005 13:31:11 +0200
Status:   

> 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

_______________________________________________
Tiff mailing list: Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
