Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas018.isp.belgacom.be (localhost [127.0.0.1])
        by inav014.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AV-3.00) with ESMTP id k7P5uZic000504
        for <joris.at.lebbeke@skynet.be>; Fri, 25 Aug 2006 07:56:36 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx015.isp.belgacom.be (inmx015.isp.belgacom.be [195.238.4.218])
        by inas018.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AS-2.03) with ESMTP id k7P5uVBv016631
        for <joris.at.lebbeke@skynet.be>; Fri, 25 Aug 2006 07:56:33 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx015.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id k7P5uMYP009406
        for <joris.at.lebbeke@skynet.be>; Fri, 25 Aug 2006 07:56:24 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id k7P5f2oj028817;
	Fri, 25 Aug 2006 01:43:36 -0400
Received: from web56612.mail.re3.yahoo.com (web56612.mail.re3.yahoo.com
	[66.196.97.56])
	by duke.maptools.org (8.12.11/8.12.10) with SMTP id k7P5erXB028814
	for <tiff@lists.maptools.org>; Fri, 25 Aug 2006 01:40:55 -0400
Received: (qmail 83346 invoked by uid 60001); 25 Aug 2006 05:40:35 -0000
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
	h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=RLuOjxQ3KT4CoHc2xF9jGA4yny7aAyJpGddywZyoKDVWzNPRQzjgGWkT/d6Spor6P5ZrF4+oA+pdMjXObLIlkU8v4OM19RdFYPb37wRdaLl1+HapJdsXJ/MUZShLdIa/Q++CAt1ttudTVCo7sDb7Q9Vkf2mbEBRk/Fc52UcRl/E=
	; 
Message-ID: <20060825054035.83344.qmail@web56612.mail.re3.yahoo.com>
Received: from [220.226.50.25] by web56612.mail.re3.yahoo.com via HTTP;
	Thu, 24 Aug 2006 22:40:35 PDT
Date: Thu, 24 Aug 2006 22:40:35 -0700 (PDT)
From: muthu kumar <muthupyr@yahoo.com>
To: tiff@lists.maptools.org
In-Reply-To: <mailman.0.1154000121.1354.tiff@lists.maptools.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Subject: [Tiff] How to find/read resolution values of TIFF image file
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.000019cc
X-MSP-STORE: Fri, 25 Aug 2006 07:56:37 +0200
Status:   

Dear Friends,

I am new to Tiff file processing.
I can read the tiff file and i used the functions to
assign the resolution of the image as follows,

uint32  w,h,bpp, xres=0, yres=0, resunit=2;

TIFFSetField(tiff,TIFFTAG_RESOLUTIONUNIT,(uint16)resunit);
TIFFSetField(tiff,TIFFTAG_XRESOLUTION,(float)xres);
TIFFSetField(tiff,TIFFTAG_YRESOLUTION,(float)yres);

and it works well. But when i tried to read the
resolution using the functions

uint32  w,h,bpp,xres=0, yres=0, resunit=0;
		
TIFFGetField(tiff, TIFFTAG_XRESOLUTION, &xres); 
TIFFGetField(tiff, TIFFTAG_YRESOLUTION, &yres);  
TIFFGetField(tiff, TIFFTAG_RESOLUTIONUNIT, &resunit);

I got the results like 
   xres = 0x42900000 or   xres = 0x43960000 

I know that the 
    xres = 0x42900000 for dpi = 72 
and xres = 0x43960000 for dpi = 300

But I want to know how to calculate the dpi values
from this hex values. Is there any fomula for this.
Or the function i am using is wrong.

Please help.

Thankyou.

Muthu.J
muthupyr@yahoo.com

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
