AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2009.12.07 16:06 "[Tiff] Problems with multiple strip G4 to single strip G4 tiff.", by Phillip Wiles
2010.01.08 00:13 "[Tiff] can please anybody help?", by Kavallieratou Ergina
2010.01.07 17:42 "[Tiff] create simple tiff", by Kavallieratou Ergina
2010.01.07 18:05 "Re: [Tiff] create simple tiff", by Bob Friesenhahn
2010.01.07 23:51 "Re: [Tiff] create simple tiff", by Kavallieratou Ergina
2010.01.20 01:30 "Re: [Tiff] 2010.01.11 09:47 "Re: me again...", by Gerben Vos", by Kavallieratou Ergina
2010.01.08 00:39 "Re: [Tiff] can please anybody help?", by Brad Hards
2010.01.08 23:53 "[Tiff] me again...", by Kavallieratou Ergina
[...]

2010.01.07 17:42 "[Tiff] create simple tiff", by Kavallieratou Ergina

I try to create a simple tiff from raw data by using the code:

TIFF *out= TIFFOpen("ar.tif", "w");

TIFFSetField (out, TIFFTAG_IMAGEWIDTH, imagen->width);

TIFFSetField(out, TIFFTAG_IMAGELENGTH, imagen->height);

TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 1);

TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 1);

TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);

TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);

TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); BYTE *bits;

for (int y = 0; y < imagen->height; y++)
{
bits= imagen->data[y];
if (TIFFWriteScanline(out,bits, y, 0)==-1) cout<<"Complete or error";
}

the values of imagen is always 0 or 1 and the format of imagen is:

struct gen

{

BYTE** data;

unsigned short int width;

unsigned short int height;

unsigned short int bits_per_pixel;

};

However a black image is created in the file with small white lines. what am I doing wrong?

please help

gin