Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx-i.one.com (mx-i.one.com [91.198.169.56])
	by mail6.b-one.net (Postfix) with ESMTP id BB48B80104420
	for <filtered@awaresystems.be>; Thu,  5 Jul 2012 18:35:59 +0200 (CEST)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx-i: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.160.48 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48])
	by mx-i.one.com (Postfix) with ESMTP id 3E1BC11E7B6
	for <filtered@awaresystems.be>; Thu,  5 Jul 2012 16:35:59 +0000 (UTC)
Received: by pbbrq8 with SMTP id rq8so14662058pbb.21
        for <filtered@awaresystems.be>; Thu, 05 Jul 2012 09:35:58 -0700 (PDT)
Received: by 10.68.228.102 with SMTP id sh6mr29325446pbc.134.1341506158204;
        Thu, 05 Jul 2012 09:35:58 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.143.92.14 with SMTP id u14csp31671wfl;
        Thu, 5 Jul 2012 09:35:57 -0700 (PDT)
Received: by 10.66.74.195 with SMTP id w3mr38370264pav.64.1341506156094;
        Thu, 05 Jul 2012 09:35:56 -0700 (PDT)
Received-SPF: softfail (google.com: best guess record for domain of transitioning tiff-bounces@lists.maptools.org does not designate 91.198.169.248 as permitted sender) client-ip=91.198.169.248;
Received: by 10.68.235.175 with POP3 id un15mf12299852pbc.37;
        Thu, 05 Jul 2012 09:35:56 -0700 (PDT)
X-Gmail-Fetch-Info: info@awaresystems.be 1 pop.awaresystems.be 110 info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-q.one.com (mx-q.one.com [91.198.169.248])
	by mail6.b-one.net (Postfix) with ESMTP id DBE9980139528
	for <info@awaresystems.be>; Thu,  5 Jul 2012 18:34:27 +0200 (CEST)
X-Greylist: accepted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx-q.one.com (Postfix) with ESMTP id 818E91E7AEC
	for <info@awaresystems.be>; Thu,  5 Jul 2012 16:34:27 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id F00131EDB62;
	Thu,  5 Jul 2012 11:33:15 -0500 (EST)
Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com
	[209.85.217.172])
	by lists.maptools.org (Postfix) with ESMTPS id 272841EDB5C
	for <tiff@lists.maptools.org>; Thu,  5 Jul 2012 11:10:08 -0500 (EST)
Received: by lbbgo11 with SMTP id go11so11738062lbb.3
	for <tiff@lists.maptools.org>; Thu, 05 Jul 2012 09:10:07 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.152.48.37 with SMTP id i5mr26505692lan.36.1341504607185; Thu,
	05 Jul 2012 09:10:07 -0700 (PDT)
Received: by 10.112.133.161 with HTTP; Thu, 5 Jul 2012 09:10:06 -0700 (PDT)
In-Reply-To: <4FF5B870.8070703@kit.edu>
References: <4FF438B3.8030802@kit.edu>
	<CAAcuQeYH7paKLjL4R0j-tDhG8Dvy18d4RTAyhbssjYmyo7g=Vw@mail.gmail.com>
	<4FF5B870.8070703@kit.edu>
Date: Thu, 5 Jul 2012 12:10:06 -0400
Message-ID: <CAAcuQebAfucrdv4Z-qrLFj8AhGNoPbfvuV8A3VL=1q9hayD=Eg@mail.gmail.com>
From: Olivier Paquet <olivier.paquet@gmail.com>
To: Simon Ochsenreither <simon.ochsenreither@kit.edu>
Cc: tiff@lists.maptools.org
Subject: Re: [Tiff] How to set the "physical size" of an image when writing
 a Tiff file?
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
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>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

On Thu, Jul 5, 2012 at 11:53 AM, Simon Ochsenreither
<simon.ochsenreither@kit.edu> wrote:
> I ran tiffinfo on the file and the resolution seems to be off. I grepped the
> output, so that it only prints the resolution, and I got the following:

Yes, infinite is clearly wrong.

> All the images have the same pixel width and height. Is resolution computed
> from other values or is it set by the user?

It is set directly but it is a rational value (a / b) so it is
possible the software writing the TIFF did something bad. Try
tiffdump, it might give more information about the invalid values in
some cases.

> This drift from infinity to other values is very weird. Shouldn't it be the
> same value?
> What do you recommend?

Anything goes when something is invalid. Try tiffdump and see what the
resolution looks like there. Either way, it's quite likely the TIFF
resolution metadata is hopelessly broken. However, the physical size
you're after appears to be also stored in an XML blob in the
ImageDescription tag. You should look into parsing that if you must
read these files and they can't be fixed at the source. It's not
standard obviously but it'll get you something which works. If you can
get the software generating the files fixed, even better.

Olivier
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
