Problem(s) in dealing with TIFF n Geo TIFF

classic Classic list List threaded Threaded
1 message Options
TSP
Reply | Threaded
Open this post in threaded view
|

Problem(s) in dealing with TIFF n Geo TIFF

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


Treat yourself at a restaurant, spa, resort and much more with Rediff Deal ho jaye!
_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff