
Thread
2004.11.16 05:10 "[Tiff] regarding tiff to bitmap", by Meenatchi Raja Rajeshwari
Hi all,
i want to convert a tiff file in to a bitmap file. can anybody help me regarding that. i have some problem with the following code
TIFF *inpimage=NULL;
inpimage=TIFFOpen("D:\\output_files\\appurgb280multi13x18.tiff", "w");
uint32 imwidth=800;
int imheight=800;
// int h=TIFFGetField(inpimage, TIFFTAG_IMAGEWIDTH, &imwidth);
// TIFFGetField(inpimage, TIFFTAG_IMAGELENGTH, &imheight);
tsize_t imlinesize_bytes=TIFFScanlineSize(inpimage);
uint8 *read_buff=(uint8 *)malloc(imlinesize_bytes*imheight);
BYTE *bits=read_buff;
for(int row=1;row<=imheight;row++)
{
if (TIFFReadScanline(inpimage,bits, row, 0)==-1)
AfxMessageBox("Complete or error",MB_OK,NULL);
bits=read_buff+row*imwidth;
}
The return value of TIFFScanlineSize is wrong.
Regards,
aparna