Return-Path: <tiff-bounces@remotesensing.org>
Received: from inmx017.isp.belgacom.be (inmx017.isp.belgacom.be [195.238.2.129])
        by mailst035.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id j2MIwnMk020318
        for <joris.at.lebbeke@skynet.be>; Tue, 22 Mar 2005 19:58:49 +0100
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx017.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id j2MIwaMH025281
        for <joris.at.lebbeke@skynet.be>; Tue, 22 Mar 2005 19:58:39 +0100
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id CBDF517212D9; Tue, 22 Mar 2005 13:58:16 -0500 (EST)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.205])
	by xserve.flids.com (Postfix) with ESMTP id B5F6D17212B1
	for <tiff@remotesensing.org>; Tue, 22 Mar 2005 13:58:14 -0500 (EST)
Received: by wproxy.gmail.com with SMTP id 71so1289517wri
	for <tiff@remotesensing.org>; Tue, 22 Mar 2005 10:58:14 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com;
	h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references;
	b=QsnDlhSD/4bJNoi/zUvBLZJ6z8xyVVMoevgMLA6cgpwUeM9Vx6YrNcCpdYsbkbvxeLoJGHmX0H9OJ5sZuvqZm1Eg8TIU2aw02NtduggEPoGnbHhFuovVbla2pgSJiqh2gu/zrtP28z4JIfZpfPkMSITmEgMP97NjZ37Tl94Cs5E=
Received: by 10.54.18.29 with SMTP id 29mr7788011wrr;
	Tue, 22 Mar 2005 10:58:14 -0800 (PST)
Received: by 10.54.13.2 with HTTP; Tue, 22 Mar 2005 10:58:14 -0800 (PST)
Message-ID: <931f8ea905032210585e5a90cc@mail.gmail.com>
Date: Tue, 22 Mar 2005 13:58:14 -0500
From: Frank Warmerdam <fwarmerdam@gmail.com>
To: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
Subject: Re: [Tiff] Interface to query compression/subformat parameters
In-Reply-To: <Pine.SOC.4.60.0503221241540.8945@blade.simplesystems.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
References: <Pine.SOC.4.60.0503221241540.8945@blade.simplesystems.org>
Cc: Tiff List <tiff@remotesensing.org>
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: warmerdam@pobox.com
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: b14ba638a055fbd928f711690d63a906

On Tue, 22 Mar 2005 12:45:03 -0600 (CST), Bob Friesenhahn
<bfriesen@simple.dallas.tx.us> wrote:
> Libtiff does not appear to provide a way by which the dependent
> application may determine the supported TIFF encoding formats,
> parameters supported by those encoding formats.  It also does not
> appear to provide a way to determine the available compression
> options.  For example, I don't see a way to see if LZW compression is
> supported by libtiff.
> 
> The ability to query for this information should be added so that
> libtiff becomes easier to use in open-source environments where the
> author of the dependent application is not also responsible for
> providing libtiff.

Bob, 

In the not to distant past (perhaps last spring?) Andrey added
the TIFFGetConfiguredCODECS() function to get a list of available
codecs.  It doesn't give details of how those codecs are configured
of course.  Does it do what you need?  I use it like this when I try
to describe to the user what codecs are enabled:
        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>" );
        }
        _TIFFfree( codecs );
#endif        


-- 
---------------------------------------+--------------------------------------
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
_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
