2005.12.13 18:20 "[Tiff] read and write image with same TIFF handle", by Шебеко Евгений

2005.12.13 21:39 "Re: [Tiff] read and write image with same TIFF handle", by Andrey Kiselev


On Tue, Dec 13, 2005 at 08:20:05PM +0200, Шебеко Евгений wrote:

As I see, I cann't to read and write image data in one session, i.e. using one TIFF handle.

The problem in codec's setup. There are only one flags in libtiff TIFF_CODERSETUP that indicate that codec inited for decode, or code process (tif->tif_setupdecode,tif->tif_setupencode)

First call TIFFReadTile() for example codec setup for decode.

Then later TIFFWriteTile() but TIFF_CODERSETUP still set and tif->tif_setupencode never called. As a result libtiff crash in codec.

Is it known problem?

Yes, it is.

Is in plans to fix it?

Yes, but no timeframe :-)

Is problem with codec is only one problem to read and write image with same TIFF handle?

Certainly there are more problems with that. However, it should be possible to open uncompressed images in update mode (yes, I am remember one of your previous posts related to problem with TIFFAppendToStrip, it is not fixed yet, but will be fixed before the next release). More problems with compressed files: every codec should be revised and corrected. There was an attempt to do that and now update mode works in some cases.

Actually I can to fix it itself.

It is not dificult replace TIFF_CODERSETUP with 2 flags

TIFF_CODERSETUP, TIFF_DECODERSETUP and to control in initialization code that only one flag could be set.

2. question
   When next version of libtiff are expected?

I am planning to release it before the holidays. But you always can take the fresh snapshot from CVS.

    If I make some useful changes in libtiff may I expect that this
   changes will be included in libtiff? And how can I do it?

Of course, contributions are always welcome. The algorithm is simple:

  1. Grab the CVS snapshot.
  2. Prepare patch using diff utility (unified patches with "diff -u" command are most convinent).
  3. Create Bugzilla report and attach your patch to it.

Best regards,


Andrey V. Kiselev
ICQ# 26871517