Return-Path: <tiff-bounces@remotesensing.org>
Received: from infbav002.isp.belgacom.be (infbav002.isp.belgacom.be [195.238.2.85])
        by mailst034.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id i9LDEZil001368
        for <joris.at.lebbeke@skynet.be>; Thu, 21 Oct 2004 15:14:35 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from inav004.isp.belgacom.be (inav004.isp.belgacom.be [195.238.3.237])
        by infbav002.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-FALLBACK-2.32) with ESMTP id i9LDDkTS015608
        for <joris.at.lebbeke@skynet.be>; Thu, 21 Oct 2004 15:13:47 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from inas006.isp.belgacom.be (localhost [127.0.0.1])
        by inav004.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id i9LDDiT6011356
        for <joris.at.lebbeke@skynet.be>; Thu, 21 Oct 2004 15:13:44 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from inmx006.isp.belgacom.be (inmx006.isp.belgacom.be [195.238.2.106])
        by inas006.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id i9LDDTBM029845
        for <joris.at.lebbeke@skynet.be>; Thu, 21 Oct 2004 15:13:34 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx006.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id i9LDDLjd027070
        for <joris.at.lebbeke@skynet.be>; Thu, 21 Oct 2004 15:13:22 +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 8BE3F3DC086; Thu, 21 Oct 2004 09:13:09 -0400 (EDT)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from arrow.wiznet.ca (arrow.wiznet.ca [216.138.223.232])
	by xserve.flids.com (Postfix) with ESMTP id 3D66C3DC063
	for <tiff@remotesensing.org>; Thu, 21 Oct 2004 09:13:08 -0400 (EDT)
Received: from [192.168.2.6] (H156.C195.tor.velocet.net [216.138.195.156])
	by arrow.wiznet.ca (Postfix) with ESMTP
	id 68AE1604B; Thu, 21 Oct 2004 09:13:07 -0400 (EDT)
Message-ID: <4177B627.7090001@pobox.com>
Date: Thu, 21 Oct 2004 09:14:15 -0400
From: Frank Warmerdam <warmerdam@pobox.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Sachin Garg <schngrg@gmail.com>
Subject: Re: [Tiff] the BitsPerSymbol tag
References: <b35303704102011401c1217fa@mail.gmail.com>	<4176C1C8.6090406@pobox.com>
	<b353037041020214388b9985@mail.gmail.com>	<4177433F.7030307@pobox.com>
	<b353037041020224928b8f81f@mail.gmail.com>
In-Reply-To: <b353037041020224928b8f81f@mail.gmail.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Tiff mailing list <tiff@remotesensing.org>
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: 67805860281dc201167f1abaf94a391a

Sachin Garg wrote:
> But I was just wondering if there is some way for my program to
> gracefully exit, instead of dying with a memory-crash etc... One
> option I can think of is a warning/error when reading the
> BitsPerSample if its found to be different for different samples.
> 
> I think it will be better if it is added in libtiff, instead of me
> adding it in my copy.

Sachin,

TIFFOpen() should fail issuing a message via normal TIFF error mechanisms.
The call looks like:

	TIFFError(tif->tif_name,
		  "Cannot handle different per-sample values for field \"%s\"",
	          _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);

You should be able to catch this the way you would catch any other TIFF
error.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

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