Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx-g.one.com (mx-g.one.com [91.198.169.54])
	by mail6.local (Postfix) with ESMTP id 2E9468014FAEB
	for <filtered@awaresystems.be>; Wed, 15 May 2013 18:12:40 +0200 (CEST)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx-g: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.217.170 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170])
	by mx-g.one.com (Postfix) with ESMTP id E1992C46882
	for <filtered@awaresystems.be>; Wed, 15 May 2013 16:12:39 +0000 (UTC)
Received: by mail-lb0-f170.google.com with SMTP id t11so2078991lbd.15
        for <filtered@awaresystems.be>; Wed, 15 May 2013 09:12:39 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received
         :domainkey-status:received-spf:x-gmail-fetch-info:delivered-to
         :x-virus-scanned:x-greylist:message-id:date:from:user-agent
         :mime-version:to:x-tm-as-product-ver:x-tm-as-result
         :x-imss-scan-details:x-tmase-version:x-tmase-result
         :x-tmase-matchedrid:subject:x-beenthere:x-mailman-version:precedence
         :list-id:list-unsubscribe:list-archive:list-post:list-help
         :list-subscribe:content-type:content-transfer-encoding:sender
         :errors-to;
        bh=4Hz98sg1fApxV8ExZApomRMZbwKqPP8pq4dUEftQeBc=;
        b=pmNo4RGgv/9IBga/JirEIhll/TrOkN6sT+uF+F7oanH/Fah/93oGABLq4SKkeKBzTK
         zj5DscdXukLDq2ys51bM9CBOg+qb3fmTJ+njZ9XRiMKT08QkuzZ+nY/GQhHZQB47DoL/
         QbySmIkk6veK6XMBioTk/bLDRnqzVmp9pJHgenjx5b6l8iCoYj8ibBVMFvMpmhT7tyZD
         b6cgcju7GRjT2LuNywWpY8c2OznD4rPBqFjNqJTj4CZbH+Qj8iTN1ju5JXHF98nxteGZ
         oyE+L6AtnNtXSrFx4t74Ifwk8mLWsPHl9tkkIpZnb/iR8K3N/kM/v6qZvMPYeWtYdRvA
         dtLg==
X-Received: by 10.112.155.202 with SMTP id vy10mr17968959lbb.51.1368634359087;
        Wed, 15 May 2013 09:12:39 -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.114.29.36 with SMTP id g4csp20975ldh;
        Wed, 15 May 2013 09:12:38 -0700 (PDT)
X-Received: by 10.112.198.199 with SMTP id je7mr170549lbc.110.1368634357607;
        Wed, 15 May 2013 09:12:37 -0700 (PDT)
DomainKey-Status: bad format
Received-SPF: neutral (google.com: 91.198.169.51 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=91.198.169.51;
Received: by 10.152.99.180 with POP3 id er20mf1109104lab.31;
        Wed, 15 May 2013 09:12:37 -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-d.one.com (mx-d.one.com [91.198.169.51])
	by mail6.local (Postfix) with ESMTP id D21B18014FAEB
	for <info@awaresystems.be>; Wed, 15 May 2013 17:59:13 +0200 (CEST)
X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (ks365428.kimsufi.com [94.23.4.142])
	by mx-d.one.com (Postfix) with ESMTP id A1FFD943856
	for <info@awaresystems.be>; Wed, 15 May 2013 15:59:13 +0000 (UTC)
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 2DD6535C03E;
	Wed, 15 May 2013 10:58:26 -0500 (EST)
Received: from iguard1-226.hkbn.net (iguard1-226.hkbn.net [203.186.220.226])
	by lists.maptools.org (Postfix) with ESMTP id 6242F35C03C
	for <tiff@lists.maptools.org>; Wed, 15 May 2013 10:55:31 -0500 (EST)
Received: from outguard01.hkbn.net ([203.186.94.187])
	by iguard1.hkbn.net with ESMTP; 15 May 2013 23:55:23 +0800
Received: from outguard01.hkbn.net (unknown [127.0.0.1])
	by IMSVA (Postfix) with ESMTP id 7CCE83D003C
	for <tiff@lists.maptools.org>; Wed, 15 May 2013 23:55:22 +0800 (HKT)
Received: from smtpo.ctimail.com (unknown [203.186.94.58])
	by outguard01.hkbn.net (Postfix) with ESMTP id 62E503D003D
	for <tiff@lists.maptools.org>; Wed, 15 May 2013 23:55:22 +0800 (HKT)
Received: from i7.coppice.org (123203240234.ctinets.com [123.203.240.234])
	by smtpo.ctimail.com (8.14.5/8.14.5) with ESMTP id r4FFtJNf024362
	for <tiff@lists.maptools.org>; Wed, 15 May 2013 23:55:22 +0800
Message-ID: <5193AFE6.9060605@coppice.org>
Date: Wed, 15 May 2013 23:55:18 +0800
From: Steve Underwood <steveu@coppice.org>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130311 Thunderbird/17.0.4
MIME-Version: 1.0
To: tiff@lists.maptools.org
X-TM-AS-Product-Ver: IMSVA-8.2.0.1391-7.0.0.1014-19868.000
X-TM-AS-Result: No--2.306-9.9-31-10
X-imss-scan-details: No--2.306-9.9-31-10;No--2.306-5.0-31-10
X-TMASE-Version: IMSVA-8.2.0.1391-7.0.1014-19868.000
X-TMASE-Result: 10--2.306200-5.000000
X-TMASE-MatchedRID: r3NKrH+qlfFYq83Yddfpbq/YJam6n9m0pLOv1YSZntzJYIv7y0tu9hU3
	wdcgT5TyDyJca3cvTEqnHerJWSojFB8s1hW5PBS1JLEgWUxgq8K063Wh9WVqgpxSu1RP8S9J+gt
	Hj7OwNO19R4Ss0oUmJ1P656+zp5Si2zSzQhOPITBkafWq7BXF0nEHASaDqjSzvvtqLwVpK8IMNG
	ERplpk6dArouKRbac4boJgd4AWA8iLRR3Rzl+2oFuiKFt7/vYEor/sAyudYPghRL+eMRd+newIY
	AjyfVvu
Subject: [Tiff] tiffcmp does not always exit with a sensible completion code.
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

Hi,

In recent versions of tiffcmp.c I find this section

     if (!CheckShortTag(tif1, tif2, TIFFTAG_BITSPERSAMPLE, "BitsPerSample"))
         return (0);
     if (!CheckShortTag(tif1, tif2, TIFFTAG_SAMPLESPERPIXEL, 
"SamplesPerPixel"))
         return (0);
     if (!CheckLongTag(tif1, tif2, TIFFTAG_IMAGEWIDTH, "ImageWidth"))
         return (0);
     if (!cmptags(tif1, tif2))
         return (1);

which ensures that if I try to compare two images of different sizes the 
program reports the difference and stops, but does not set the 
completion code to something non-zero. A script using tiffcmp to compare 
images cannot detect that the compare has failed. If I change this to:

     if (!CheckShortTag(tif1, tif2, TIFFTAG_BITSPERSAMPLE, "BitsPerSample"))
         return (1);
     if (!CheckShortTag(tif1, tif2, TIFFTAG_SAMPLESPERPIXEL, 
"SamplesPerPixel"))
         return (1);
     if (!CheckLongTag(tif1, tif2, TIFFTAG_IMAGEWIDTH, "ImageWidth"))
         return (1);
     if (!cmptags(tif1, tif2))
         return (1);

I get the expected behaviour, and the program terminates with completion 
status 1 as it does with any other kind of difference between the images.

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