<DIV>Dear Sir,</DIV>
<DIV>I am new to handling TIFF & 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> </DIV>
<DIV>My C++/MFC program is able to read the tags, but I am getting errors:</DIV>
<DIV> </DIV>
<DIV>short int xres, yres, unit, modeltypecode;</DIV>
<DIV>...</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>TIFFGetField(intif, TIFFTAG_XRESOLUTION, &xres);</DIV>
<DIV>
<DIV>TIFFGetField(intif, TIFFTAG_YRESOLUTION, &yres);</DIV>
<DIV>
<DIV>TIFFGetField(intif, TIFFTAG_RESOLUTIONUNIT, &unit);</DIV>
<DIV> </DIV>
<DIV>... /* But the values of xres, etc. are quite strange */</DIV>
<DIV> </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> </DIV>
<DIV>/* The program halts at one of the TIFFSets */</DIV>
<DIV> </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> </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> </DIV>
<DIV>With many thanks,</DIV>
<DIV> </DIV>
<DIV>Yours sincerely,</DIV>
<DIV> 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>