2005.04.26 15:07 "[Tiff] Floating points to TIFF", by Bastien Guende

2005.04.26 21:20 "Re: [Tiff] Floating points to TIFF", by Andrey Kiselev

I'm developping a soft to convert my binary raw file of floating points to TIFF format. I'm using libtiff with these tags:

TIFFSetField(ficout, TIFFTAG_IMAGEWIDTH,width   );
TIFFSetField(ficout, TIFFTAG_IMAGELENGTH,length );
TIFFSetField(ficout, TIFFTAG_BITSPERSAMPLE,32 ); //floating points=4Bytes
TIFFSetField(ficout, TIFFTAG_PHOTOMETRIC,34892  );
TIFFSetField(ficout, TIFFTAG_PLANARCONFIG,1     );

So I'm using 1band images with floating points (4Bytes)

My program writes the right amount of rows (1per strip), but i get 1byte data in output instead of 4bytes!!!

I think i missed something...

I'm saving data like this:
raster=my raw data, filout=my output if file

// Write the information to the file
for (i=0; i<length; i++)
        for (j=0; j<width; j++)
                TIFFWriteRawStrip(filout, i, raster2, width);


In addition to Joris' recommendations you can take a look at raw2tiff utility from the libtiff package. It does exactly what you want (though it may be a bit more flexible than you may need).


Andrey V. Kiselev
Home phone: +7 812 5970603 ICQ# 26871517