[Gdal-dev] Bug fix in BMP support

Frank Warmerdam warmerdam at pobox.com
Tue Jun 17 13:09:02 EDT 2003

Andrey Kiselev wrote:
> On Tue, Jun 17, 2003 at 09:24:41AM -0400, Frank Warmerdam wrote:
>>I would add that I don't see why bmpdataset.cpp should even be closing the
>>file managed by the GDALOpenInfo.  Do you have a specific reason this needs
>>to be done?  If not, please don't.
> Frank,
> I want reopen the file with large-file interface, so I'm closing opened
> handler before reopening. Why do you think it is wrong?


The general practice would be to go ahead and open it with the large file API,
but not to close the regular file handle.  The GDALOpen() API will take care
of it later.  I generally try to only fiddle with the GDALOpenInfo's file
pointer when I want to "adopt it" in the driver, in which case I set the
pointer to NULL, taking ownership of it.

However, there isn't really any harm in your closing it ... it just seems

Of course, using the wrong API function to close it is ... wrong.

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the Gdal-dev mailing list