Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx-j.one.com (mx-j.one.com [91.198.169.57])
	by mail6.b-one.net (Postfix) with ESMTP id 4360C80103FD6
	for <filtered@awaresystems.be>; Tue,  3 Jul 2012 19:57:54 +0200 (CEST)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx-j: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.160.176 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-gh0-f176.google.com (mail-gh0-f176.google.com [209.85.160.176])
	by mx-j.one.com (Postfix) with ESMTP id D462B2835E1
	for <filtered@awaresystems.be>; Tue,  3 Jul 2012 17:57:53 +0000 (UTC)
Received: by ghbz10 with SMTP id z10so7149647ghb.21
        for <filtered@awaresystems.be>; Tue, 03 Jul 2012 10:57:53 -0700 (PDT)
Received: by 10.68.191.72 with SMTP id gw8mr9235734pbc.143.1341338272367;
        Tue, 03 Jul 2012 10:57:52 -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 u14csp104663wfl;
        Tue, 3 Jul 2012 10:57:51 -0700 (PDT)
Received: by 10.68.227.198 with SMTP id sc6mr9159760pbc.138.1341338270325;
        Tue, 03 Jul 2012 10:57:50 -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.250 as permitted sender) client-ip=91.198.169.250;
Received: by 10.68.235.132 with POP3 id um4mf8592078pbc.20;
        Tue, 03 Jul 2012 10:57:50 -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-s.one.com (mx-s.one.com [91.198.169.250])
	by mail6.b-one.net (Postfix) with ESMTP id 5022E80103FD6
	for <info@awaresystems.be>; Tue,  3 Jul 2012 19:56:51 +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-s.one.com (Postfix) with ESMTP id EDF923A9012
	for <info@awaresystems.be>; Tue,  3 Jul 2012 17:56:50 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id ECC271EDB14;
	Tue,  3 Jul 2012 12:55:20 -0500 (EST)
Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130])
	by lists.maptools.org (Postfix) with ESMTP id BB9C21EDB14
	for <tiff@lists.maptools.org>; Tue,  3 Jul 2012 12:53:27 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
	by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q63HrPri010866;
	Tue, 3 Jul 2012 13:53:25 -0400 (EDT)
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dinar Valeev <dinarv@gmail.com>
In-reply-to: <CADqALGTJGUTwSqzmN4EGZ-zAcAw_fDMKtGjuG1n6MsgDNt6jqg@mail.gmail.com>
References: <CADqALGTJGUTwSqzmN4EGZ-zAcAw_fDMKtGjuG1n6MsgDNt6jqg@mail.gmail.com>
Comments: In-reply-to Dinar Valeev <dinarv@gmail.com>
	message dated "Thu, 28 Jun 2012 11:23:22 +0200"
Date: Tue, 03 Jul 2012 13:53:25 -0400
Message-ID: <10865.1341338005@sss.pgh.pa.us>
Cc: tiff@lists.maptools.org
Subject: Re: [Tiff] tiff 4.0.2 raw_decode test failing on ppc64
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>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

Dinar Valeev <dinarv@gmail.com> writes:
> rgba part of the raw_decode test fails on ppc64 machine:

I received a patch for this, uncredited but apparently originating
somewhere in opensuse:

diff -up tiff-4.0.2/test/raw_decode.c.bigendian tiff-4.0.2/test/raw_decode.c
--- tiff-4.0.2/test/raw_decode.c.bigendian	2012-07-03 15:27:37.168543695 +0200
+++ tiff-4.0.2/test/raw_decode.c	2012-07-03 15:28:47.795051599 +0200
@@ -85,9 +85,9 @@ static int check_rgb_pixel( int pixel, i
 static int check_rgba_pixel( int pixel, int red, int green, int blue, int alpha, unsigned char *buffer ) {
 	/* RGBA images are upside down - adjust for normal ordering */
 	int adjusted_pixel = pixel % 128 + (127 - (pixel/128)) * 128;
-	unsigned char *rgba = buffer + 4 * adjusted_pixel;
+	unsigned int *rgba = (unsigned int*)(buffer + 4 * adjusted_pixel);
 	
-	if( rgba[0] == red && rgba[1] == green && rgba[2] == blue && rgba[3] == alpha ) {
+	if( TIFFGetR(*rgba) == red && TIFFGetG(*rgba) == green && TIFFGetB(*rgba) == blue && TIFFGetA(*rgba) == alpha ) {
 		return 0;
 	}
 

Now, this patch is crummy --- for one thing it ought to correct the
fprintf call just below here.  But I think it's on the right track: the
result of TIFFReadRGBAImage is documented to be accessed via these
macros not directly.  Does anyone think this is not an appropriate fix
approach?

			regards, tom lane
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
