Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas015.isp.belgacom.be (localhost [127.0.0.1])
        by inav014.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id k1KLRTQl002324
        for <joris.at.lebbeke@skynet.be>; Mon, 20 Feb 2006 22:27:30 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx012.isp.belgacom.be (inmx012.isp.belgacom.be [195.238.5.90])
        by inas015.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id k1KLRReG031930
        for <joris.at.lebbeke@skynet.be>; Mon, 20 Feb 2006 22:27:27 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx012.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id k1KLRMIp016168
        for <joris.at.lebbeke@skynet.be>; Mon, 20 Feb 2006 22:27:23 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
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 k1KLKXiu015715;
	Mon, 20 Feb 2006 16:21:43 -0500
Received: from exprod6og20.obsmtp.com (exprod6og20.obsmtp.com [64.18.1.145])
	by duke.maptools.org (8.12.11/8.12.10) with SMTP id k1KLKUX7015712
	for <tiff@lists.maptools.org>; Mon, 20 Feb 2006 16:20:30 -0500
Received: from source ([192.150.20.142]) by exprod6ob20.obsmtp.com
	([64.18.5.12]) with SMTP; Mon, 20 Feb 2006 13:20:28 PST
Received: from inner-relay-3.eur.adobe.com (inner-relay-3b [10.128.4.236])
	by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id
	k1KLKW46029434; Mon, 20 Feb 2006 13:20:32 -0800 (PST)
Received: from fe1.corp.adobe.com (fe1.corp.adobe.com [10.8.192.70])
	by inner-relay-3.eur.adobe.com (8.12.10/8.12.9) with ESMTP id
	k1KLKErs024437; Mon, 20 Feb 2006 13:20:25 -0800 (PST)
Received: from namail3.corp.adobe.com ([10.8.192.66]) by fe1.corp.adobe.com
	with Microsoft SMTPSVC(6.0.3790.1830); 
	Mon, 20 Feb 2006 13:20:14 -0800
Received: from 153.32.50.221 ([153.32.50.221]) by namail3.corp.adobe.com
	([10.8.192.66]) via Exchange Front-End Server
	namailhost.corp.adobe.com ([10.8.192.72]) with Microsoft
	Exchange Server HTTP-DAV ; Mon, 20 Feb 2006 21:20:11 +0000
User-Agent: Microsoft-Entourage/11.2.1.051004
Date: Mon, 20 Feb 2006 13:20:13 -0800
Subject: Re: [Tiff] TIFFReadScanline query
From: Chris Cox <ccox@adobe.com>
To: Benares <benarestham@gmail.com>, TIFF <tiff@lists.maptools.org>
Message-ID: <C01F728D.282D0%ccox@adobe.com>
Thread-Topic: [Tiff] TIFFReadScanline query
Thread-Index: AcY2Y2+urfQpyKJWEdqXVgAKlZxm+A==
In-Reply-To: <9e46d1bb0602192354k39768df3tb290d0a5fa8bf59f@mail.gmail.com>
Mime-version: 1.0
X-OriginalArrivalTime: 20 Feb 2006 21:20:14.0124 (UTC)
	FILETIME=[7059E6C0:01C63663]
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="===============1093940899=="
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.0000130a
X-MSP-STORE: Mon, 20 Feb 2006 22:27:33 +0100
Status:   

> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--===============1093940899==
Content-type: multipart/alternative;
	boundary="B_3223286413_135297994"

> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--B_3223286413_135297994
Content-type: text/plain;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

That sounds like you=B9re getting the thumbnail image and not the full size
image.
Are you sure this camera isn=B9t saving a RAW file and you=B9re just reading th=
e
RGB thumbnail?

Chris



On 2/19/06 11:54 PM, "Benares" <benarestham@gmail.com> wrote:

> I've some difficulty parsing the tiff image information into a raster arr=
ay to

> hold these values, processing the raster data then write the resulting da=
ta
> into another tiff image. I've tried using the TIFFReadScanline function t=
o
> parse these data, however my image would not appear as the original. I'm
> wondering where actually went wrong. Could anybody help advise?
>=20
> My tiff file is extracted from a Kodak digital camera model DC290. The de=
fault
> file information are as follows.
>=20
> IMAGEWIDTH: 720
> IMAGEHEIGHT: 480
> SAMPLESPERPIXEL: 3
> ROWSPERSTRIP: 3
> BITSPERSAMPLE: 8
> PLANARCONFIG: 1 (Chunky)
> ORIENTATION: 1 (Top-Left)
> PHOTOMETRIC: 2 (RGB)
>=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DReading in the image information into
> pic_buffer=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>     int j, k, row_counter, offset;
>     tsize_t ScanlineSize =3D TIFFScanlineSize(tiffRead);       //ScanlineSi=
ze =3D
> 2160 =3D 720*3
>=20
>     uint32* pic_buffer =3D (uint32*)_TIFFmalloc(sizeof(uint32) * imageWidth=
 *
> imageHeight);
>     uint32* line_buffer =3D (uint32*)_TIFFmalloc(sizeof(uint32) * ScanlineS=
ize);
>=20
>     k=3D0;
>     for (row_counter=3D0; row_counter<imageHeight; row_counter++)
>     {
>         TIFFReadScanline(tiffRead , line_buffer , row_counter);
>        for( j=3D0; j<ScanlineSize; j+=3D3 )           //reading RGB value fro=
m
> file and combining into pixel[k]
>         {
>            pic_buffer[k] =3D    ( ((((uint32)line_buffer[j]) <<8<<8
> )&0x00FF0000)
>                           | ((((uint32)line_buffer[j+1]) <<8 )&0x0000FF00=
)
>                           | (((uint32)line_buffer[j+2])&0x000000FF) );
>             k++;
>         }
>     }
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DReading in the image information into
> pic_buffer=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DWriting the image information into
> output.tif=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>     for (row_counter=3D0; row_counter<imageHeight; row_counter++)
>     {
>         k=3D0;
>         offset =3D row_counter*imageWidth;
>         for (j=3D0; j<imageWidth; j++)
>         {
>            line_buffer[k] =3D (uint32)((pic_buffer[j+offset]&0x00FF0000)>>8=
>>8);
> //Red content
>            line_buffer[k+1] =3D (uint32)((pic_buffer[j+offset]&0x0000FF00)>=
>8);
> //Green content
>            line_buffer[k+2] =3D (uint32)(pic_buffer[j+offset]&0x000000FF);
> //Blue content
>             k+=3D3;
>         }
>         TIFFWriteScanline(tiffWrite, line_buffer , row_counter, 0);
>     }
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DWriting the image information into
> output.tif=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
> Thanks to all whom have read and/or made a reply to this amateurish entry=
.
>=20
>=20
> _______________________________________________
> Tiff mailing list: Tiff@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/



--B_3223286413_135297994
Content-type: text/html;
	charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

<HTML>
<HEAD>
<TITLE>Re: [Tiff] TIFFReadScanline query</TITLE>
</HEAD>
<BODY>
<FONT FACE=3D"Verdana, Helvetica, Arial"><SPAN STYLE=3D'font-size:12.0px'>That =
sounds like you&#8217;re getting the thumbnail image and not the full size i=
mage.<BR>
Are you sure this camera isn&#8217;t saving a RAW file and you&#8217;re jus=
t reading the RGB thumbnail?<BR>
<BR>
Chris<BR>
<BR>
<BR>
<BR>
On 2/19/06 11:54 PM, &quot;Benares&quot; &lt;benarestham@gmail.com&gt; wrot=
e:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE=3D"Verdana, Helvetica, Arial"><SPAN STYL=
E=3D'font-size:12.0px'>I've some difficulty parsing the tiff image information=
 into a raster array to hold these values, processing the raster data then w=
rite the resulting data into another tiff image. I've tried using the TIFFRe=
adScanline function to parse these data, however my image would not appear a=
s the original. I'm wondering where actually went wrong. Could anybody help =
advise?<BR>
<BR>
My tiff file is extracted from a Kodak digital camera model DC290. The defa=
ult file information are as follows.<BR>
<BR>
IMAGEWIDTH: 720<BR>
IMAGEHEIGHT: 480<BR>
SAMPLESPERPIXEL: 3<BR>
ROWSPERSTRIP: 3<BR>
BITSPERSAMPLE: 8<BR>
PLANARCONFIG: 1 (Chunky)<BR>
ORIENTATION: 1 (Top-Left)<BR>
PHOTOMETRIC: 2 (RGB)<BR>
<BR>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DReading in the image information into pic_buffer=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR>
&nbsp;&nbsp;&nbsp;&nbsp;int j, k, row_counter, offset;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;tsize_t ScanlineSize =3D TIFFScanlineSize(tiffRead); =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//ScanlineSize =3D 2160 =3D 720*3<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;uint32* pic_buffer =3D (uint32*)_TIFFmalloc(sizeof(ui=
nt32) * imageWidth * imageHeight);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;uint32* line_buffer =3D (uint32*)_TIFFmalloc(sizeof(u=
int32) * ScanlineSize);<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;k=3D0;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;for (row_counter=3D0; row_counter&lt;imageHeight; row=
_counter++)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;{<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TIFFReadScanline(tiffRead ,=
 line_buffer , row_counter);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for( j=3D0; j&lt;ScanlineSize; j+=3D3=
 ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//reading RGB=
 value from file and combining into pixel[k]<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pic_buffe=
r[k] =3D &nbsp;&nbsp;&nbsp;( ((((uint32)line_buffer[j]) &lt;&lt;8&lt;&lt;8 )&a=
mp;0x00FF0000)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;| ((((uint32)line_buffer[j+1]) &lt;&lt;8 )&amp;0x0000FF00)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;| (((uint32)line_buffer[j+2])&amp;0x000000FF) );<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k++=
;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DReading in the image information into pic_buffer=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR>
<BR>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DWriting the image information into output.tif=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D<BR>
&nbsp;&nbsp;&nbsp;&nbsp;for (row_counter=3D0; row_counter&lt;imageHeight; row=
_counter++)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;{<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k=3D0;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offset =3D row_counter*imageW=
idth;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (j=3D0; j&lt;imageWidth; =
j++)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line_buff=
er[k] =3D (uint32)((pic_buffer[j+offset]&amp;0x00FF0000)&gt;&gt;8&gt;&gt;8); &=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Red content<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line_buff=
er[k+1] =3D (uint32)((pic_buffer[j+offset]&amp;0x0000FF00)&gt;&gt;8); &nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;//Green content<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line_buff=
er[k+2] =3D (uint32)(pic_buffer[j+offset]&amp;0x000000FF); &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Blue content<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k+=3D=
3;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TIFFWriteScanline(tiffWrite=
, line_buffer , row_counter, 0);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DWriting the image information into output.tif=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D<BR>
<BR>
Thanks to all whom have read and/or made a reply to this amateurish entry.<=
BR>
<BR>
<HR ALIGN=3DCENTER SIZE=3D"3" WIDTH=3D"95%"></SPAN></FONT><FONT SIZE=3D"2"><FONT FA=
CE=3D"Monaco, Courier New"><SPAN STYLE=3D'font-size:10.0px'>____________________=
___________________________<BR>
Tiff mailing list: Tiff@lists.maptools.org<BR>
<a href=3D"http://lists.maptools.org/mailman/listinfo/tiff">http://lists.mapt=
ools.org/mailman/listinfo/tiff</a><BR>
<a href=3D"http://www.remotesensing.org/libtiff/">http://www.remotesensing.or=
g/libtiff/</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE><FONT SIZE=3D"2"><FONT FACE=3D"Monaco, Courie=
r New"><SPAN STYLE=3D'font-size:10.0px'><BR>
</SPAN></FONT></FONT>
</BODY>
</HTML>


--B_3223286413_135297994--


--===============1093940899==
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/
--===============1093940899==--

