AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2006.05.10 18:00 "[Tiff] Tiff throws error on tiffinfo but not with tiffdump", by Jeremy Nix
2006.05.10 18:16 "Re: [Tiff] Tiff throws error on tiffinfo but not with tiffdump", by Bob Friesenhahn
2006.05.10 19:13 "Re: [Tiff] Tiff throws error on tiffinfo but not with tiffdump", by Gerben Vos
2006.05.23 11:03 "[Tiff] Question to TIFF mailing list", by Alexey Aushev
2006.05.23 12:13 "[Tiff] Question to TIFF mailing list", by Gerben Vos

2006.05.23 12:13 "[Tiff] Question to TIFF mailing list", by Gerben Vos

   I'm novice at TIFF coding. Would you say me, please, why my output 24-bit color image has no this IFD part? Here is the simpliest example of output of 10x10 image, using TIFFWriteEncodedStrip().

Your IFD is perfect. You even showed it to us in the tiffdump output! No problem there.

But you are a bit confused about the image data.

uint32 *raster;

char *raster;

if ((raster = (uint32 *) malloc(sizeof (uint32) * width * height * 3)) == NULL)

if ((raster = (char *) malloc(width * height * 3)) == NULL)

for (unsigned int i=0; i<width*height; i++)

{

   raster[i] = 0xffacacac;

}

for (unsigned int i=0; i<width*height * 3; i += 3)
{
        raster[i] = 0xac;

        raster[i + 1] = 0xac;
        raster[i + 2] = 0xac;

        // To use this test, add #include <stdlib.h> at the top of the program.
        //raster[i] = rand() & 0xFF;
        //raster[i + 1] = rand() & 0xFF;
        //raster[i + 2] = rand() & 0xFF;
}

Hope this helps,

Gerben Vos.