Return-Path: <tiff-admin@remotesensing.org>
Received: from inmx009.isp.belgacom.be (inmx009.isp.belgacom.be [195.238.3.146])
        by mailst006.isp.belgacom.be (8.12.9/8.12.9/Skynet-MAILSTORE-2.14) with ESMTP id i4FKgmTH030988
        for <joris.at.lebbeke@skynet.be>; Sat, 15 May 2004 22:42:48 +0200
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com ([208.24.120.44])
        by inmx009.isp.belgacom.be (8.12.9/8.12.9/Skynet-IN-2.32) with ESMTP id i4FKggQX008468
        for <joris.at.lebbeke@skynet.be>; Sat, 15 May 2004 22:42:43 +0200
        (envelope-from <tiff-admin@remotesensing.org>)
Received: from yoda.imagelinks.com (localhost.localdomain [127.0.0.1])
	by yoda.imagelinks.com (8.11.6/8.11.6) with ESMTP id i4FKfGn23275;
	Sat, 15 May 2004 16:41:16 -0400
Received: from fuzzylog.simplesystems.org (fuzzylog.simplesystems.org [65.66.246.65])
	by yoda.imagelinks.com (8.11.6/8.11.6) with ESMTP id i4FKe9n23204
	for <tiff@remotesensing.org>; Sat, 15 May 2004 16:40:09 -0400
Received: from scooby.simplesystems.org (scooby.simplesystems.org [65.66.246.67])
	by fuzzylog.simplesystems.org (8.9.3/8.9.3) with ESMTP id PAA13890;
	Sat, 15 May 2004 15:39:46 -0500 (CDT)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@scooby.simplesystems.org
To: R Seidl <rseidl@canoma.com>
cc: tiff@remotesensing.org
Subject: Re: [Tiff] TIFFWriteScanline endian swapping issue
In-Reply-To: <6.1.0.6.2.20040515114421.02d2cf38@earthlink.net>
Message-ID: <Pine.GSO.4.44.0405151537020.21890-100000@scooby.simplesystems.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: tiff-admin@remotesensing.org
Errors-To: tiff-admin@remotesensing.org
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.0.13
Precedence: bulk
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Post: <mailto:tiff@remotesensing.org>
List-Subscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
List-Id: TIFF and libtiff discussion <tiff.remotesensing.org>
List-Unsubscribe: <http://remotesensing.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://remotesensing.org/pipermail/tiff/>
Date: Sat, 15 May 2004 15:39:48 -0500 (CDT)
X-UIDL: 9c0a79156adfa8e304e335ae1ef97717

On Sat, 15 May 2004, R Seidl wrote:
>
> uint32 row;
> for( row=0; row<src.Size().fY; row++) {
>          // fill buffer from our TImage data
>          if (!TIFFWriteScanline(tif, tdata_t(src.PixelPtr(row)), row))
>          TIFFError("WriteImage","failure in WriteScanline\n");
> }
>
> When I write my RGB or RGBA images this way, it looks like the bytes are
> written in such an order that other programs on my PC (like Photoshop,
> CompuPic) display the "wrong" (eg byte flipped) images.

>From your sample code I can't tell how "TImage data" is actually
formatted.  Maybe it is some sort of little-endian byte stream, or
maybe it is some other format used by the non-tifflib software you are
using.

Libtiff is used successfully by lots of software so any formatting
errors are likely to be in the buffer that you pass to libtiff.

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us
http://www.simplesystems.org/users/bfriesen

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