2008.02.06 10:01 "[Tiff] Why is TIFF/zip not a default option?", by Anders Sewerin Johansen

2008.02.06 17:12 "Re: [Tiff] Why is TIFF/zip not a default option?", by Frank Warmerdam

Can I conclude that most recent libtiff equiped systems (e.g. systems deployed or updated during the last five years) will support tiff/zip?

You can't really conclude anything at all. Yesterday I fixed a bug in my software related to libtiff 3.6.1. People are still using these old versions. Some commercial OSs don't automatically update to the latest version with each major release because they operate on the "If it ain't broke ..." principle.

Currently it is necessary to use defines from tiffconf.h to determine the libtiff build options used. Unfortunately, this is completely the wrong way to handle the problem. Libtiff should support a query function whereby an application can test to see if a library supports a feature at run-time.


It is possible to detect the available codecs at runtime as I do here in GDAL:

/* -------------------------------------------------------------------- */
/*      Determine which compression codecs are available that we        */
/*      want to advertise.  If we are using an old libtiff we won't     */
/*      be able to find out so we just assume all are available.        */
/* -------------------------------------------------------------------- */

         strcpy( szOptionalCompressItems,
                 "       <Value>NONE</Value>" );

#if TIFFLIB_VERSION <= 20040919
         strcat( szOptionalCompressItems,

                 "       <Value>PACKBITS</Value>"
                 "       <Value>JPEG</Value>"
                 "       <Value>LZW</Value>"
                 "       <Value>DEFLATE</Value>" );


         TIFFCodec      *c, *codecs = TIFFGetConfiguredCODECs();

         for( c = codecs; c->name; c++ )
             if( c->scheme == COMPRESSION_PACKBITS )

                 strcat( szOptionalCompressItems,
                         "       <Value>PACKBITS</Value>" );
             else if( c->scheme == COMPRESSION_JPEG )
                 strcat( szOptionalCompressItems,
                         "       <Value>JPEG</Value>" );
             else if( c->scheme == COMPRESSION_LZW )
                 strcat( szOptionalCompressItems,
                         "       <Value>LZW</Value>" );
             else if( c->scheme == COMPRESSION_ADOBE_DEFLATE )
                 strcat( szOptionalCompressItems,
                         "       <Value>DEFLATE</Value>" );
             else if( c->scheme == COMPRESSION_CCITTRLE )
                 strcat( szOptionalCompressItems,
                         "       <Value>CCITTRLE</Value>" );
             else if( c->scheme == COMPRESSION_CCITTFAX3 )
                 strcat( szOptionalCompressItems,
                         "       <Value>CCITTFAX3</Value>" );
             else if( c->scheme == COMPRESSION_CCITTFAX4 )
                 strcat( szOptionalCompressItems,
                         "       <Value>CCITTFAX4</Value>" );

         _TIFFfree( codecs );

And you are absolute right about not being able to conclude anything. If I wanted ubiquity I would not depend on Deflate or LZW compression.

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    | President OSGeo, http://osgeo.org