Message-ID: 3833C1E6.9E3B1783@binuscan.com
To: Peter Zitzelsperger <zitzelsp@geoware.de>, "tiff@olympiakos.com" <tiff@olympiakos.com>
Subject: Re: multiple tiff files
From: Ledoux <bruno_ledoux@binuscan.com>
Date: Thu, 18 Nov 1999 10:07:51 +0100
References: <383011DD.949B0365@wenninger.de>
Sender: owner-tiff@olympiakos.com




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.
> Peter.

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

bruno
BINUSCAN


