Opened 16 years ago

Last modified 16 years ago

#180 closed defect (fixed)

options have no effect when creating a GTiff from python

Reported by: alessandro_amici@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

hi,

python 2.1 and gdal-1.1.7 with internal tiff and geotiff libraries on Debian.

i need to produce a two-band BIP tiff and use the following snippet of
python code:

driver = gdal.GetDriverByName('GTiff')
out = driver.Create('image.tif', RasterXSize, RasterYSize,
                    bands=2,
                    datatype=GDT_Int16,
                    options=['INTERLEAVE=PIXEL'])

what i obtain is a perfectly working BIL tiff file!
TIFF Directory at offset 0x1edb8f92
  Image Width: 4900 Image Length: 26392
  Bits/Sample: 16
  Sample Format: signed integer
  Compression Scheme: None
  Photometric Interpretation: min-is-black
  Samples/Pixel: 2
  Rows/Strip: 1
  Planar Configuration: separate image planes

i then tried with options=['INTERLEAVE=BAND'], options=['INTERLEAVE=DOH!'],
options=[None] etc, with no error and same result.
it seems that the options argument is not used at all.

i checked in the code, but python argument parsing defeated me :(.

regards,
alessandro

Change History (2)

comment:1 Changed 16 years ago by warmerdam

This was due to a bug in the call to PyArg_ParseTuple() in py_GDALCreate()
(in gdal.i).  I have corrected, and committed the fix and the problem
seems to be resolved.

Thanks for the bug report!

comment:2 Changed 16 years ago by alessandro_amici@…

backporting the fix to 1.1.7 solved the problem.
thanks!
alessandro

Note: See TracTickets for help on using tickets.