Skip to content

Commit

Permalink
GTiff: remove support for libtiff 3.X
Browse files Browse the repository at this point in the history
libtiff 4.X has been mainstream for years now, and our legacy
libtiff 3.X code paths have not been tested in years too, so
just remove them.
  • Loading branch information
rouault committed May 7, 2019
1 parent 60c6bc9 commit e097880
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 482 deletions.
78 changes: 0 additions & 78 deletions autotest/gcore/tiff_ovr.py
Expand Up @@ -327,11 +327,6 @@ def test_tiff_ovr_8(both_endian):
def test_tiff_ovr_9(both_endian):
gdaltest.tiff_drv.Delete('tmp/ovr9.tif')

drv = gdal.GetDriverByName('GTiff')
md = drv.GetMetadata()
if md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1:
pytest.skip()

shutil.copyfile('data/rgbsmall.tif', 'tmp/ovr9.tif')

gdal.SetConfigOption('COMPRESS_OVERVIEW', 'JPEG')
Expand Down Expand Up @@ -405,15 +400,6 @@ def test_tiff_ovr_11(both_endian):
ds = gdaltest.tiff_drv.CreateCopy('tmp/ovr11.tif', src_ds)
src_ds = None

md = gdaltest.tiff_drv.GetMetadata()
if (md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1 or
int(gdal.VersionInfo('VERSION_NUM')) < 1700):
# The two following lines are necessary with inverted endianness
# for the moment with older libtiff
# See http://bugzilla.maptools.org/show_bug.cgi?id=1924 for more details
ds = None
ds = gdal.Open('tmp/ovr11.tif', gdal.GA_Update)

ds.BuildOverviews('AVERAGE', overviewlist=[2])

ds = None
Expand Down Expand Up @@ -443,15 +429,6 @@ def test_tiff_ovr_12(both_endian):
ds = gdaltest.tiff_drv.CreateCopy('tmp/ovr12.tif', src_ds, options=['COMPRESS=DEFLATE'])
src_ds = None

md = gdaltest.tiff_drv.GetMetadata()
if (md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1 or
int(gdal.VersionInfo('VERSION_NUM')) < 1700):
# The two following lines are necessary with inverted endianness
# for the moment with older libtiff
# See http://bugzilla.maptools.org/show_bug.cgi?id=1924 for more details
ds = None
ds = gdal.Open('tmp/ovr12.tif', gdal.GA_Update)

ds.BuildOverviews('AVERAGE', overviewlist=[2])

ds = None
Expand Down Expand Up @@ -532,15 +509,6 @@ def test_tiff_ovr_15(both_endian):
ds = gdaltest.tiff_drv.CreateCopy('tmp/ovr15.tif', src_ds, options=['COMPRESS=DEFLATE'])
src_ds = None

md = gdaltest.tiff_drv.GetMetadata()
if (md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1 or
int(gdal.VersionInfo('VERSION_NUM')) < 1700):
# The two following lines are necessary with inverted endianness
# for the moment with older libtiff
# See http://bugzilla.maptools.org/show_bug.cgi?id=1924 for more details
ds = None
ds = gdal.Open('tmp/ovr15.tif', gdal.GA_Update)

ds.BuildOverviews('GAUSS', overviewlist=[2])

ds = None
Expand Down Expand Up @@ -631,17 +599,10 @@ def test_tiff_ovr_18(both_endian):

###############################################################################
# Check that we can create overviews on a newly create file (#2621)
# Will cause older libtiff versions (<=3.8.2 for sure) to crash, so skip it
# if BigTIFF is not supported (this is a sign of an older libtiff...)


def test_tiff_ovr_19(both_endian):

drv = gdal.GetDriverByName('GTiff')
md = drv.GetMetadata()
if md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1:
pytest.skip()

ds = gdal.GetDriverByName('GTiff').Create('tmp/ovr19.tif', 100, 100, 1)
ds.GetRasterBand(1).Fill(1)

Expand All @@ -668,11 +629,6 @@ def test_tiff_ovr_19(both_endian):

def test_tiff_ovr_20(both_endian):

drv = gdal.GetDriverByName('GTiff')
md = drv.GetMetadata()
if md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1:
pytest.skip()

ds = gdaltest.tiff_drv.Create('tmp/ovr20.tif', 100, 100, 1)
ds = None

Expand Down Expand Up @@ -701,11 +657,6 @@ def test_tiff_ovr_20(both_endian):

def test_tiff_ovr_21(both_endian):

drv = gdal.GetDriverByName('GTiff')
md = drv.GetMetadata()
if md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1:
pytest.skip()

ds = gdaltest.tiff_drv.Create('tmp/ovr21.tif', 170000, 100000, 1, options=['SPARSE_OK=YES'])
ds = None

Expand Down Expand Up @@ -734,11 +685,6 @@ def test_tiff_ovr_21(both_endian):

def test_tiff_ovr_22(both_endian):

drv = gdal.GetDriverByName('GTiff')
md = drv.GetMetadata()
if md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1:
pytest.skip()

ds = gdaltest.tiff_drv.Create('tmp/ovr22.tif', 170000, 100000, 1, options=['SPARSE_OK=YES'])
ds = None

Expand Down Expand Up @@ -767,11 +713,6 @@ def test_tiff_ovr_22(both_endian):

def test_tiff_ovr_23(both_endian):

drv = gdal.GetDriverByName('GTiff')
md = drv.GetMetadata()
if md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1:
pytest.skip()

ds = gdaltest.tiff_drv.Create('tmp/ovr23.tif', 170000, 100000, 1, options=['SPARSE_OK=YES'])
ds = None

Expand Down Expand Up @@ -802,11 +743,6 @@ def test_tiff_ovr_23(both_endian):

def test_tiff_ovr_24(both_endian):

drv = gdal.GetDriverByName('GTiff')
md = drv.GetMetadata()
if md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1:
pytest.skip()

ds = gdaltest.tiff_drv.Create('tmp/ovr24.tif', 85000, 100000, 1, options=['SPARSE_OK=YES'])
ds = None

Expand Down Expand Up @@ -1001,11 +937,6 @@ def test_tiff_ovr_31(both_endian):

def test_tiff_ovr_32(both_endian):

drv = gdal.GetDriverByName('GTiff')
md = drv.GetMetadata()
if md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1:
pytest.skip()

# 4 regular band
shutil.copyfile('data/stefan_full_rgba_photometric_rgb.tif', 'tmp/ovr32.tif')

Expand Down Expand Up @@ -1258,11 +1189,6 @@ def test_tiff_ovr_37(both_endian):

def test_tiff_ovr_38(both_endian):

# Skip with old libtiff (crash with 3.8.2)
md = gdaltest.tiff_drv.GetMetadata()
if md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1:
pytest.skip()

src_ds = gdal.Open('../gdrivers/data/n43.dt0')
ds = gdaltest.tiff_drv.CreateCopy('tmp/ovr38.tif', src_ds, options=['COMPRESS=LZW', 'PREDICTOR=2'])
ds.BuildOverviews(overviewlist=[2, 4])
Expand Down Expand Up @@ -1550,10 +1476,6 @@ def test_tiff_ovr_45(both_endian):

def test_tiff_ovr_46():

md = gdaltest.tiff_drv.GetMetadata()
if md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1:
pytest.skip()

if not gdaltest.run_slow_tests():
pytest.skip()

Expand Down
9 changes: 0 additions & 9 deletions autotest/gcore/tiff_read.py
Expand Up @@ -1061,11 +1061,6 @@ def test_tiff_read_online_2():

def test_tiff_read_huge4GB():

# Need libtiff 4.X anyway
md = gdal.GetDriverByName('GTiff').GetMetadata()
if md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1:
pytest.skip()

if not gdaltest.filesystem_supports_sparse_files('tmp'):
ds = gdal.Open('data/huge4GB.tif')
assert ds is not None
Expand All @@ -1089,10 +1084,6 @@ def test_tiff_read_huge4GB():

def test_tiff_read_bigtiff():

md = gdal.GetDriverByName('GTiff').GetMetadata()
if md['DMD_CREATIONOPTIONLIST'].find('BigTIFF') == -1:
pytest.skip()

ds = gdal.Open('data/byte_bigtiff_strip5lines.tif')
cs = ds.GetRasterBand(1).Checksum()
ds = None
Expand Down

0 comments on commit e097880

Please sign in to comment.