AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1999.11.15 13:59 "multiple tiff files", by Peter Zitzelsperger
1999.11.18 09:07 "Re: multiple tiff files", by Ledoux
1999.11.19 10:16 "Re: multiple tiff files", by Peter Zitzelsperger

1999.11.18 09:07 "Re: multiple tiff files", by Ledoux

Peter Zitzelsperger wrote:

Hi,

Hi all!

I've been developing on some TIFF stuff on WIN NT with the libtiff*, I can create images, draw some stuff and save them properly. Now I find the need to create multiple TIFF images, and nothing works any more. So, what's the basic idea about multiple tiffs? My suggestion is:

If your purpose is to save multiple images in the same tiff file, the exact term is multipage tiff, I can assure that the libtiff supports it without any problem, provided that you ONLY use the libtif functions to read or write tiles.

         // open tiff file with TIFFOpen(...)

Do you open file in mapped "w" mode or unmapped "wu" mode? Just a question normally it shouldn't affect the file.

         // over all images
        for( i4_image_count=0;
i4_image_count<m_pt_image->GetNumImages(); i4_image_count++ )
        {
            TIFFSetDirectory( tiff_file, i4_image_count );

            // set some basic tifftags like imagelength, imagewidth,
samplesperpixel, bitspersample,...

            // write the data in tiles
            m_pt_image->WriteBuffer2Tiles( tiff_file,
                                m_pt_image->GetImageLength(
i4_image_count ),
                                m_pt_image->GetImageWidth(
i4_image_count ),
                                i4_image_count );

What is your WriteBuffer2Tiles method doing? does it call TIFFWriteTiles or any other IO function to write to the file?

             TIFFWriteDirectory( tiff_file );
        }

This should guarantee, that every image entry has its own specific info and data.The trouble I run into is, that

    -this loop works well for two images, after that, _TIFFalloc fails
to get storage
    -this loop works well for, say nine images, but the file created
file has only two entrys, the second
     of which has strange values for the tags(samples per pixel,...)

I have no obvoius idea about where the code runs into trouble, perhaps you had a sinmilar problem?

*the libtiff version is 0.37 beta concerning the pathname, but version 0.24beta concerning the entry in the projectfile, that comes with the lib. Strange...? The lib itself compiles 'well' with DEV Studio 97 and Visual c++ 5.0 wih only 70 warnings.

Thanks for any ideas.

Don't hesitate to contact me if you have any other problem.

bruno
BINUSCAN