Opened 20 years ago

Last modified 20 years ago

#616 closed defect (fixed)

libtiff build options on unix deficient

Reported by: warmerdam Owned by: dron
Priority: high Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description

As of GDAL 1.2.2 if an internal libtiff is used it will be built without
several compression options as reported by Julien Demaria:

Julien Demaria wrote:
> Hi,
> 
> Maybe I'm wrong but it seems that at least PACKBITS and LZW TIFF 
> compressions are disabled under Unix in the current GDAL CVS (and in 
> 1.2.2 version) :
> in frmts/gtiff/libtiff/GNUmakefile only pass the -DZIP_SUPPORT 
> -DPIXARLOG_SUPPORT -DJPEG_SUPPORT
> and the makefile.vc pass -DCCITT_SUPPORT -DPACKBITS_SUPPORT -DLZW_SUPPORT \
>         -DTHUNDER_SUPPORT -DNEXT_SUPPORT -DLOGLUV_SUPPORT \
>         -DZIP_SUPPORT -DPIXARLOG_SUPPORT -DJPEG_SUPPORT

The short term patch is to change:

ALL_C_FLAGS	=	$(CFLAGS) -DZIP_SUPPORT -DPIXARLOG_SUPPORT -I../../zlib

to:

ALL_C_FLAGS	=	$(CFLAGS) -I../../zlib \
			-DCCITT_SUPPORT -DPACKBITS_SUPPORT -DLZW_SUPPORT \
			-DTHUNDER_SUPPORT -DNEXT_SUPPORT -DLOGLUV_SUPPORT \
			-DZIP_SUPPORT -DPIXARLOG_SUPPORT

However, in the long term I think the configuration options should be in 
tif_config.h instead of in the makefile so that windows and unix will stay
in sync and thing won't be so fragile.

Change History (5)

comment:1 by warmerdam, 20 years ago

Julien Demaria wrote:
> Frank,
> 
> should I also add the other options from makefile.vc (fillorder, 
> stripchop, extrasample, ycbcr_subsampling, $(jpeg_flags)) ? :
> 
> in makefile.vc :
> EXTRAFLAGS =    -I..\..\zlib -DFILLODER_LSB2MSB \
>                 -DCCITT_SUPPORT -DPACKBITS_SUPPORT -DLZW_SUPPORT \
>                 -DTHUNDER_SUPPORT -DNEXT_SUPPORT -DLOGLUV_SUPPORT \
>                 -DZIP_SUPPORT -DPIXARLOG_SUPPORT \
>                 -DSTRIPCHOP_DEFAULT=TIFF_STRIPCHOP \
>                 -DDEFAULT_EXTRASAMPLE_AS_ALPHA 
> -DCHECK_JPEG_YCBCR_SUBSAMPLING \
>                 $(JPEG_FLAGS)

comment:2 by dron, 20 years ago

Ok, I think now it is finally fixed.

comment:3 by warmerdam, 20 years ago

Andrey,

I did a CVS update and quick build in frmts/gtiff/libtiff and there was
no evidence that things were building properly yet.  I tried putting a
#error in the body of tif_zip.c and it did not activate, suggesting that it
wasn't compiling the body. 

How did you change things?  The only change I noticed coming out in the CVS update
was to makefile.vc though the log message suggests there were changes to 
tif_config.h.

comment:4 by dron, 20 years ago

Ah, looks like I'm forgot to commit the new tif_config.h. Will do that tomorrow
morning along with the changes to get the TIFF driver list. 

comment:5 by dron, 20 years ago

I have checked in the missing files and updates from libtiff CVS tree. These are
includes fix for missed codecs and a new function to get the codecs list. The
sample code follows.

#include <stdio.h>
#include <tiffio.h>

int main(int argc, char **argv)
{
    TIFFCodec	*c, *codecs = TIFFGetConfiguredCODECs();

    printf("Codec Name:\tCodec Scheme:\n\n");
    for (c = codecs; c->name; c++)
	printf("%s\t%d\n", c->name, c->scheme);
    
    _TIFFfree(codecs);

    return 0;
}

Program output:

Codec Name:     Codec Scheme:

None    1
LZW     5
PackBits        32773
ThunderScan     32809
NeXT    32766
JPEG    7
CCITT RLE       2
CCITT RLE/W     32771
CCITT Group 3   3
CCITT Group 4   4
Deflate 32946
AdobeDeflate    8
PixarLog        32909
SGILog  34676
SGILog24        34677
Note: See TracTickets for help on using tickets.