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

2005.12.13 21:55 "Re: [Tiff] read and write image with same TIFF handle", by Frank Warmerdam

On 12/13/05, Шебеко Евгений <shebeko@mail.ru> wrote:

1 question.

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?


I have experienced similar issues.

Is in plans to fix it?

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

Reading and writing an image with the same handle opened in update mode is supported fine for uncompressed images, so I believe the problem is only related to the compression codecs.

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?
   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?

This is a very fragile aspect of the code. While we would appreciate a carefully constructed patch, I am personally very concerned about unintended consequences and if we can't make ourselves comfortable with the patch, it won't be applied to the core library.

Best regards,


I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent