Opened 16 years ago

Closed 16 years ago

#2153 closed defect (fixed)

Perl Geo::OGR::Dataset->GetDriver() broken in 1.5.0

Reported by: dgrichard Owned by: Ari Jolma
Priority: normal Milestone:
Component: PerlBindings Version: 1.5.0
Severity: major Keywords: swig perl
Cc:

Description

The following Perl code is working in 1.4.2 :

$ds= Geo::GDAL::Open('anImage.tif'); $drv= $ds->GetDriver();

while it is broken in 1.5.0 reporting on exec the following :

TypeError in method 'GetDriverByName', argument 1 of type 'char const *'

Change History (2)

comment:1 by Ari Jolma, 16 years ago

Oops. It is called _GetDriver, i.e.,

$ds= Geo::GDAL::Open('c:\lumihiutale.jpg');
$drv= $ds->_GetDriver();

works. The reason is that I wanted to wrap GetDriver in Geo::GDAL and accidentally overwrote GetDriver with _GetDriver also in Geo::GDAL::Dataset. $ds->GetDriver calls Geo::GDAL::GetDriver, since Geo::GDAL::Dataset is a subclass of Geo::GDAL, which expects a number or a string. The fix is easy, just add *GetDriver = *_GetDriver; into Geo::GDAL::Dataset.

Frank, I think this should be fixed also in 1.5 so that it will be fixed in 1.5.1. How do I do that? Do I make the change to the 1.5 branch?

Ari

comment:2 by Ari Jolma, 16 years ago

Resolution: fixed
Status: newclosed

Fixed in r13523 in the trunk and in r13525 in branches/1.5

Note: See TracTickets for help on using tickets.