AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2005.04.26 15:07 "[Tiff] Floating points to TIFF", by GUENDE
2005.04.26 15:41 "Re: [Tiff] Floating points to TIFF", by Joris
2005.04.27 07:20 "Re: [Tiff] Floating points to TIFF", by GUENDE
2005.04.26 21:20 "Re: [Tiff] Floating points to TIFF", by Andrey Kiselev
2005.04.29 20:32 "RE: [Tiff] Adobe Photoshop Corrupt TIFF", by Bill Bither
2005.04.29 19:44 "[Tiff] Adobe Photoshop Corrupt TIFF", by Bill Bither
2005.04.29 20:37 "Re: [Tiff] Adobe Photoshop Corrupt TIFF", by Chris Cox
2005.04.29 20:02 "Re: [Tiff] Adobe Photoshop Corrupt TIFF", by Andrey Kiselev
2005.04.29 20:48 "RE: [Tiff] Adobe Photoshop Corrupt TIFF", by Chris Cox
2005.04.29 21:53 "RE: [Tiff] Adobe Photoshop Corrupt TIFF", by Bill Bither
2005.04.29 22:34 "RE: [Tiff] Adobe Photoshop Corrupt TIFF", by Chris Cox
2005.04.30 13:31 "RE: [Tiff] Adobe Photoshop Corrupt TIFF", by Bill Bither
2005.05.01 17:55 "RE: [Tiff] Adobe Photoshop Corrupt TIFF", by Chris Cox
2005.04.30 19:07 "Re: [Tiff] Adobe Photoshop Corrupt TIFF", by Andrey Kiselev

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

Hi!

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_ROWSPERSTRIP,1);
TIFFSetField(ficout, TIFFTAG_SAMPLEFORMAT,SAMPLEFORMAT_IEEEFP );
TIFFSetField(ficout, TIFFTAG_PLANARCONFIG,1 );
TIFFSetField(ficout, TIFFTAG_SAMPLESPERPIXEL,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++)
                raster2[j]=raster[i*width+j];
                TIFFWriteRawStrip(filout, i, raster2, width);
}
TIFFClose(filout);

So:

My test data is a 4920*5116 image of float (4Bytes/pixel) My output data is a 4920*5116 image of Byte (1Byte/pixel)

If someone could help me...

Thanks,

Bastien