From: zuyuan.wang@wsl.ch (Zuyuan Wang)
Date: Fri, 31 Oct 2003 11:41:05 +0100
Subject: [Tiff] Re: ask for suggestions....
In-Reply-To: <3FA1B218.9010708@pobox.com>
References: <5.2.1.1.1.20031030164934.00ebad40@mail.wsl.ch>
 <5.2.1.1.1.20031030164934.00ebad40@mail.wsl.ch>
Message-ID: <5.2.1.1.1.20031031112957.00eb82a0@mail.wsl.ch>

Dear Frank,
   Thanks very much for your mail. Because I am a new to TIFF, there is so 
many problem.... Thanks again for your kind help.
    After I used the 'TIFFReadTile(IN_tif, buf_8,col,row,0,0)' to read the 
tile data, I used 'bufscanline_8[position]=(buf_8[(x+y*tileWidth)*3])' to 
read out the data,but when I print it out, they are all like
'-842150451'. It shows that I make the wrong way for reading the data out. 
On the other hand, I tried TIFFGerR() to get the data, and later on write 
it into the file, but the file could not be open.
  Would you like to tell me 1)what's the format of the tile image read by 
the TIFFReafTile, is it 'RGBRGBRGB....', for my image,  they are 
'PLANARCONFIG_CONTIG'.
  2)How to use ' TIFFWrteScanline'? Is it possible for me to read one tile 
image line by line, and write into file line by line by using ' 
TIFFWriteScanline' ?

  Many thanks....
  Best regards!
  Zuyuan



At 19:51 30.10.2003 -0500, you wrote:
>Zuyuan Wang wrote:
>>Dear All,
>>   I am dealing with the very huge TIFF tiled image. What I want to do 
>> now is first read the different tile image by ' TIFFReadTile' into a 
>> buffer, then I want to save it as a new TIFF image again. I used the ' 
>> TIFFWriteScanline', but the writen file can't be opened. I have the 
>> following questions:
>>  1) how can I read the data out from the tile data? Should I use ' 
>> TIFFGetR', 'TIFFGetG' and 'TIFFGetB'?
>>  2) when I get the data, how can i write them into the file?
>>  Waiting for your kind suggestions!
>
>Zuyuan,
>
>tiff-admin is the wrong email address.   You should email 
>tiff@remotesensing.org.
>
>The brief answers are:
>
>1) You will need to extract the data from the tile buffer returned by
>TIFFReadTile() manually based on the various data organization indicators
>in other tags, like planar configuration, number of samples, and bits per
>sample.
>
>2) I don't know why the file writtenwith TIFFWriteScanline() cannot be
>opened.  You would need to supply more information.  A "tiffinfo" and 
>"tiffdump"
>report on the output file may be helpful.
>
>Best regards,
>
>--
>---------------------------------------+--------------------------------------
>I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
>light and sound - activate the windows | http://pobox.com/~warmerdam
>and watch the world go round - Rush    | Geospatial Programmer for Rent
>
>




------
Zuyuan Wang
Swiss Federal Research Institute WSL
Zuercherstr. 111, CH-8903 Birmensdorf, SWITZERLAND
Phone: +41 1 739 2691   Fax: +41 1 739 2215
Email:  zuyuan.wang@wsl.ch  


