AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
February 2008

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2008.02.06 10:01 "Why is TIFF/zip not a default option?", by Anders Sewerin Johansen
2008.02.06 10:34 "Re: Why is TIFF/zip not a default option?", by Andrey Kiselev
2008.02.06 11:05 "Re: Why is TIFF/zip not a default option?", by Anders Sewerin Johansen
2008.02.06 11:28 "Re: Why is TIFF/zip not a default option?", by Andy Cave
2008.02.06 11:46 "Re: Why is TIFF/zip not a default option?", by Andrey Kiselev
2008.02.06 16:36 "Re: Why is TIFF/zip not a default option?", by Bob Friesenhahn
2008.02.06 17:12 "Re: Why is TIFF/zip not a default option?", by Frank Warmerdam
2008.02.06 17:14 "Re: Tiff Digest, Vol 45, Issue 3", by Gary Mcgath
2008.02.07 17:23 "Re: Tiff Digest, Vol 45, Issue 3", by Gerben Vos

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

Bob Friesenhahn wrote:
> On Wed, 6 Feb 2008, Anders Sewerin Johansen wrote:
>>
>> 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.

Bob,

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>" );
#else
         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 );
#endif


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