<DIV>Dear Sir,</DIV>
<DIV>I am new to handling TIFF&nbsp;&amp; Geo TIFF files and got libtiff.lib and geotiff.lib along with header files and so on. I have a problem. I want to read a (Geo) TIFF file, do some calculations on the actual pixels and write into a new (non existing) file. </DIV>
<DIV>&nbsp;</DIV>
<DIV>My&nbsp;C++/MFC program is able to read the tags, but I am getting errors:</DIV>
<DIV>&nbsp;</DIV>
<DIV>short int xres, yres, unit, modeltypecode;</DIV>
<DIV>...</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>TIFFGetField(intif, TIFFTAG_XRESOLUTION, &amp;xres);</DIV>
<DIV>
<DIV>TIFFGetField(intif, TIFFTAG_YRESOLUTION, &amp;yres);</DIV>
<DIV>
<DIV>TIFFGetField(intif, TIFFTAG_RESOLUTIONUNIT, &amp;unit);</DIV>
<DIV>&nbsp;</DIV>
<DIV>... /* But the values of xres, etc. are quite strange */</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV>TIFFSetField(outtif, TIFFTAG_XRESOLUTION, xres);</DIV>
<DIV>
<DIV>TIFFSetField(outtif, TIFFTAG_YRESOLUTION, yres);</DIV>
<DIV>
<DIV>TIFFSetField(outtif, TIFFTAG_RESOLUTIONUNIT, unit);</DIV>
<DIV>&nbsp;</DIV>
<DIV>/* The program halts at one of the TIFFSets */</DIV>
<DIV>&nbsp;</DIV>
<DIV>To admit, I don't have any skill on how to read pixel values from an existing TIFF data. I tried things like TIFFReadScanLine or such, but before reaching the reading, the program gives an error and exits. Of course TIFF reading is not a joke at all and it seems I will take ages to complete my work.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Can you please send me source code to reliably read TIFF files and if possible, copy the same into a new TIFF file. Your help will be greatly appreciated.</DIV>
<DIV>&nbsp;</DIV>
<DIV>With many thanks,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Yours sincerely,</DIV>
<DIV>&nbsp;T.S. Prasad</DIV></DIV></DIV></DIV></DIV></DIV><br><A HREF="http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?" target="_blank"><IMG SRC="http://sigads.rediff.com/RealMedia/ads/adstream_nx.ads/www.rediffmail.com/signatureline.htm@Middle"></A><br>Treat yourself at a restaurant, spa, resort and much more with <b><a href="http://track.rediff.com/click?url=___http://dealhojaye.rediff.com?sc_cid=mailsignature___&cmp=signature&lnk=rediffmailsignature&newservice=deals" target ="_new">Rediff Deal ho jaye!</a></b>