Received: from mailgate009.isp.belgacom.be (mailgate009.isp.belgacom.be [195.238.6.2])
	by maildelivery010.isp.belgacom.be (Postfix) with ESMTP id 4F9F41DC003
	for <joris.at.lebbeke@skynet.be>; Mon, 14 Jan 2008 08:50:18 +0100 (CET)
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 14 Jan 2008 08:50:17 +0100
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m0E7TWZl019778;
	Mon, 14 Jan 2008 02:29:44 -0500
Received: from outbound6-sin-R.bigfish.com (outbound-sin.frontbridge.com
	[207.46.51.80])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m0E7TJhN019772
	for <tiff@lists.maptools.org>; Mon, 14 Jan 2008 02:29:20 -0500
Received: from outbound6-sin.bigfish.com (localhost.localdomain [127.0.0.1])
	by outbound6-sin-R.bigfish.com (Postfix) with ESMTP id 4F3E1A3A271;
	Mon, 14 Jan 2008 07:29:15 +0000 (UTC)
Received: from mail39-sin-R.bigfish.com (unknown [10.3.40.3])
	by outbound6-sin.bigfish.com (Postfix) with ESMTP id 3F694C78057;
	Mon, 14 Jan 2008 07:29:15 +0000 (UTC)
Received: from mail39-sin (localhost.localdomain [127.0.0.1])
	by mail39-sin-R.bigfish.com (Postfix) with ESMTP id C793511082A8;
	Mon, 14 Jan 2008 07:29:14 +0000 (UTC)
X-BigFish: VP
X-MS-Exchange-Organization-Antispam-Report: OrigIP: 195.35.232.6;Service: EHS
Received: by mail39-sin (MessageSwitch) id 1200295753665730_31965;
	Mon, 14 Jan 2008 07:29:13 +0000 (UCT)
Received: from smtp.oce.com (smtp.oce.com [195.35.232.6])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail39-sin.bigfish.com (Postfix) with ESMTP id CFB46D28051;
	Mon, 14 Jan 2008 07:29:11 +0000 (UTC)
Received: from oce-exbhcs01b.oce.net by smtp.oce.com id m0E7Pwnb027605
Received: from oce-exbh02.oce.net ([10.99.4.106]) by oce-exbhcs01b.oce.net
	with Microsoft SMTPSVC(6.0.3790.3959); 
	Mon, 14 Jan 2008 08:25:58 +0100
Received: from OVL-EXBE01.ocevenlo.oce.net ([134.188.143.21]) by
	oce-exbh02.oce.net with Microsoft SMTPSVC(6.0.3790.3959); 
	Mon, 14 Jan 2008 08:25:58 +0100
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: RE: [Tiff] TIFFWriteScanline - write band orders
Date: Mon, 14 Jan 2008 08:25:57 +0100
Message-ID: <C2F34B4088C6514E86F06DA928A2D21803039F99@OVL-EXBE01.ocevenlo.oce.net>
In-reply-to: <22366.43818.qm@web15312.mail.cnb.yahoo.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [Tiff] TIFFWriteScanline - write band orders
Thread-Index: AchWecthmv3rtTefSQKE4QbyRgnKLQABFcAA
References: <22366.43818.qm@web15312.mail.cnb.yahoo.com>
From: "Tillaart, Rob van den" <rob.vandentillaart@oce.com>
To: "gis geo" <gis3600@yahoo.com.cn>, <tiff@lists.maptools.org>
X-OriginalArrivalTime: 14 Jan 2008 07:25:58.0399 (UTC)
	FILETIME=[B51528F0:01C8567E]
Cc: 
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
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: multipart/mixed; boundary="===============1332992541=="
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.000029e8
X-MSP-STORE: Mon, 14 Jan 2008 08:50:18 +0100
Status:   

--===============1332992541==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C8567E.B4CF044F"

------_=_NextPart_001_01C8567E.B4CF044F
Content-Type: text/plain;
	charset="GB2312"
Content-Transfer-Encoding: quoted-printable

Hi
Think the error is in the line =

       if (j =3D=3Dheight-2 )
 =

 It should be =

    if (j =3D=3D height-1)
as otherwise the last line (j=3D=3Dheight) isn't wriiten. =

 =

give it a try
rob
 =


 =


________________________________

	From: tiff-bounces@lists.maptools.org [mailto:tiff-bounces@lists.maptools.=
org] On Behalf Of gis geo
	Sent: maandag 14 januari 2008 7:33
	To: tiff@lists.maptools.org
	Subject: [Tiff] TIFFWriteScanline - write band orders
	=

	=

	Hi All,
	 =

	I am learning and testing TIFF Lib, and have experienced the following pro=
blem:
	 =

	I wish to write a 16-bit RGB imagery with separate planes, using the follo=
wing codes
	 =

	...
	  TIFFSetField(out, TIFFTAG_IMAGEWIDTH, width);  =

	  TIFFSetField(out, TIFFTAG_IMAGELENGTH, height);
	  TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 16);
	  TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 3);
	  TIFFSetField(out, TIFFTAG_PLANARCONFIG, 2);
	  TIFFSetField(out, TIFFTAG_PHOTOMETRIC, 2);
	  TIFFSetField(out, TIFFTAG_COMPRESSION, COMPRESSION_NONE); =

	  TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, TIFFDefaultStripSize(out, 1)); =


	    for (j =3D 0; j < height; j++)
	      {
	    ...
	    TIFFWriteScanline(out, buf_r, j, 0);
	    TIFFWriteScanline(out, buf_g, j, 1);
	    TIFFWriteScanline(out, buf_b, j, 2);
	  } =

	 =

	The output is fine and works. I can verify that.
	 =

	But, after I have applied a 3*3 filter analysis, and I wish to output the =
same row-by-row data in this form, and the output tiff file is wrong:
	 =

	   for (j =3D 1; j < height-1; j++)
	   {
	    ...

	   if (j =3D=3D1 )
	   {
	    TIFFWriteScanline(out, buf_r, j-1, 0);
	    TIFFWriteScanline(out, buf_g, j-1, 1);
	    TIFFWriteScanline(out, buf_b, j-1, 2);
	   }
	 =

	    TIFFWriteScanline(out, buf_r, j, 0);
	    TIFFWriteScanline(out, buf_g, j, 1);
	    TIFFWriteScanline(out, buf_b, j, 2);
	 =

	   if (j =3D=3Dheight-2 )
	   {
	    TIFFWriteScanline(out, buf_r, j+1, 0);
	    TIFFWriteScanline(out, buf_g, j+1, 1);
	    TIFFWriteScanline(out, buf_b, j+1, 2);
	   }
	  }
	 =

	I could not figure out why. This might to related to TIFFWriteScanline() a=
nd some expectation from the Tiff Lib that I did not specify.
	 =

	THANK you in advance.
	 =

	 =


	 =

	 =

	 =


	=

________________________________

	=D1=C5=BB=A2=D3=CA=CF=E4=B4=AB=B5=DD=D0=C2=C4=EA=D7=A3=B8=A3=A3=AC=B8=F6=
=D0=D4=BA=D8=BF=A8=CB=CD=C7=D7=C5=F3=A3=A1 <http://cn.mail.yahoo.com/gc/ind=
ex.html?entry=3D5&souce=3Dmail_mailletter_tagline>  =




This message and attachment(s) are intended solely for use by the addressee=
 and may contain information that is privileged, confidential or otherwise =
exempt from disclosure under applicable law.

If you are not the intended recipient or agent thereof responsible for deli=
vering this message to the intended recipient, you are hereby notified that=
 any dissemination, distribution or copying of this communication is strict=
ly prohibited.

If you have received this communication in error, please notify the sender =
immediately by telephone and with a 'reply' message.
  =

Thank you for your co-operation.


------_=_NextPart_001_01C8567E.B4CF044F
Content-Type: text/html;
	charset="GB2312"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2800.1605" name=3DGENERATOR></HEAD>
<BODY>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SP=
AN =

class=3D304522107-14012008>Hi</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D304522107-14012008><FONT face=3DA=
rial =

color=3D#0000ff size=3D2>Think the error is in the line </FONT></SPAN></DIV=
>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D304522107-14012008><FONT face=3DA=
rial =

color=3D#0000ff size=3D2><FONT color=3D#000000 =

size=3D3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (j =3D=3Dheight-2 =

)</FONT></FONT></SPAN></DIV>
<DIV><SPAN class=3D304522107-14012008><FONT face=3DArial color=3D#0000ff si=
ze=3D2><FONT =

color=3D#000000 size=3D3></FONT></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D304522107-14012008>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D304522107-14012008><FONT face=3DA=
rial =

color=3D#0000ff size=3D2>&nbsp;It should be </FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D304522107-14012008>&nbsp;&nbsp;&n=
bsp; <FONT =

face=3DArial color=3D#0000ff size=3D2>if (j =3D=3D height-1)</FONT></SPAN><=
/DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D304522107-14012008><FONT face=3DA=
rial =

color=3D#0000ff size=3D2>as otherwise the last line (j=3D=3Dheight) isn't w=
riiten. =

</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D304522107-14012008><FONT face=3DA=
rial =

color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D304522107-14012008><FONT face=3DA=
rial =

color=3D#0000ff size=3D2>give it a try</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D304522107-14012008><FONT face=3DA=
rial =

color=3D#0000ff size=3D2>rob</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D304522107-14012008><FONT face=3DA=
rial =

color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft></SPAN><BR>&nbsp;</DIV></DIV>
<BLOCKQUOTE =

style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px soli=
d; MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
  <HR tabIndex=3D-1>
  <FONT face=3DTahoma size=3D2><B>From:</B> tiff-bounces@lists.maptools.org=
 =

  [mailto:tiff-bounces@lists.maptools.org] <B>On Behalf Of </B>gis =

  geo<BR><B>Sent:</B> maandag 14 januari 2008 7:33<BR><B>To:</B> =

  tiff@lists.maptools.org<BR><B>Subject:</B> [Tiff] TIFFWriteScanline - wri=
te =

  band orders<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV>Hi All,</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>I am learning and testing TIFF Lib, and have experienced the followi=
ng =

  problem:</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>I wish to write a 16-bit RGB imagery with separate planes, using the=
 =

  following codes</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>...</DIV>
  <DIV>&nbsp;&nbsp;TIFFSetField(out, TIFFTAG_IMAGEWIDTH, =

  width);&nbsp;&nbsp;<BR>&nbsp;&nbsp;TIFFSetField(out, TIFFTAG_IMAGELENGTH,=
 =

  height);</DIV>
  <DIV>&nbsp;&nbsp;TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, =

  16);<BR>&nbsp;&nbsp;TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, =

  3);<BR>&nbsp;&nbsp;TIFFSetField(out, TIFFTAG_PLANARCONFIG, =

  2);<BR>&nbsp;&nbsp;TIFFSetField(out, TIFFTAG_PHOTOMETRIC, =

  2);<BR>&nbsp;&nbsp;TIFFSetField(out, TIFFTAG_COMPRESSION, =

  COMPRESSION_NONE);&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, =

  TIFFDefaultStripSize(out, 1));&nbsp;</DIV>
  <DIV><BR>&nbsp;&nbsp;&nbsp;&nbsp;for (j =3D 0; j &lt; height; =

  j++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp; ...</=
DIV>
  <DIV>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_r, j, =

  0);<BR>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_g, j, =

  1);<BR>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_b, j, =

  2);<BR>&nbsp;&nbsp;}&nbsp;<BR>&nbsp;</DIV>
  <DIV>The output is fine and works. I can verify that.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>But, after I have applied a 3*3 filter analysis, and I wish to outpu=
t the =

  same row-by-row data in this form, and the output tiff file is wrong:</DI=
V>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;&nbsp;for (j =3D 1; j &lt; height-1; =

  j++)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp; ...</DIV>
  <DIV><BR>&nbsp;&nbsp;&nbsp;if (j =3D=3D1 =

  )<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf=
_r, =

  j-1, 0);<BR>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_g, j-1, =

  1);<BR>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_b, j-1, =

  2);<BR>&nbsp;&nbsp;&nbsp;}</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_r, j, =

  0);<BR>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_g, j, =

  1);<BR>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_b, j, =

  2);<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;if (j =3D=3Dheight-2 =

  )<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf=
_r, =

  j+1, 0);<BR>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_g, j+1, =

  1);<BR>&nbsp;&nbsp;&nbsp; TIFFWriteScanline(out, buf_b, j+1, =

  2);<BR>&nbsp;&nbsp;&nbsp;}</DIV>
  <DIV>&nbsp;&nbsp;}</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>I could not figure out why. This might to related to TIFFWriteScanli=
ne() =

  and some&nbsp;expectation from the Tiff Lib that I did not specify.</DIV>=

  <DIV>&nbsp;</DIV>
  <DIV>THANK you in advance.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV><BR>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <P>
  <HR SIZE=3D1>
  <A =

  href=3D"http://cn.mail.yahoo.com/gc/index.html?entry=3D5&amp;souce=3Dmail=
_mailletter_tagline">=D1=C5=BB=A2=D3=CA=CF=E4=B4=AB=B5=DD=D0=C2=C4=EA=D7=A3=
=B8=A3=A3=AC=B8=F6=D0=D4=BA=D8=BF=A8=CB=CD=C7=D7=C5=F3=A3=A1</A> =

</BLOCKQUOTE><br clear=3Dall> This message and attachment(s) are intended s=
olely for use by the addressee and may contain information that is privileg=
ed, confidential or otherwise exempt from disclosure under applicable law. =
 =0D
=0D
If you are not the intended recipient or agent thereof responsible for deli=
vering this message to the intended recipient, you are hereby notified that=
 any dissemination, distribution or copying of this communication is strict=
ly prohibited.=0D
 =0D
If you have received this communication in error, please notify the sender =
immediately by telephone and with a 'reply' message.=0D
  =0D
Thank you for your co-operation.
</BODY></HTML>


------_=_NextPart_001_01C8567E.B4CF044F--


--===============1332992541==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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