Opened 12 years ago

Closed 11 years ago

#2320 closed defect (fixed)

JPEG2000 is not listed in the formats output by gdalinfo when ecw is built as a plugin

Reported by: nsavard Owned by: warmerdam
Priority: normal Milestone: 1.5.3
Component: GDAL_Raster Version: 1.5.0
Severity: normal Keywords: ECW JP2ECW
Cc: frankie

Description

I created a gdal_ecw plugin with fgs and installed it through the fgs installer but when I issue a gdalinfo --formats, JPEG2000 is not shown.

Change History (7)

comment:1 Changed 11 years ago by Even Rouault

Milestone: 1.5.2
Resolution: invalid
Status: newclosed

I think that's prefectly normal. The Jpeg2000 driver inside the gdal_ecw plugin is named "JP2ECW" and not "JPEG2000". So I'm closing this bug as an invalid.

comment:2 Changed 11 years ago by warmerdam

Keywords: ECW JP2ECW added
Milestone: 1.6.0
Resolution: invalid
Status: closedreopened

I believe the problem is that the plugin system ends up calling GDALRegister_ECW() (because the plugin is named gdal_ECW.so) and GDALRegister_JP2ECW() never gets calls. This means the JP2ECW driver isn't available, even though it is desirable that it would be.

I can imagine a few ways to correct this, but I don't find any of them appealing:

  • Build differently if we are building as a plugin, only exporting GDALRegisterMe() which would call static GDALRegister_ECW() and GDALRegister_JP2ECW() functions.
  • modify GDALRegister_ECW() to call GDALRegister_JP2ECW().

Actually, on reflection a reasonably non-disruptive change would be to build the plugin as gdal_ECW_JP2ECW.so and add a GDALRegister_ECW_JP2ECW() function that calls both registration functions. The ecwdataset.cpp code would not need to "know" if it is going to be a plugin at build time so things remain fairly simple and clean.

I'm going to turn this over to Matuesz to implement. Mateusz, I think it is sufficient to do this in trunk to avoid disruptive changes in 1.5 branch.

comment:3 Changed 11 years ago by warmerdam

Cc: warmerdam added
Owner: changed from warmerdam to Mateusz Łoskot
Status: reopenednew

comment:4 Changed 11 years ago by Even Rouault

#2385 depends on this ticket.

comment:5 Changed 11 years ago by frankie

Cc: frankie added

comment:6 Changed 11 years ago by warmerdam

Cc: warmerdam removed
Owner: changed from Mateusz Łoskot to warmerdam

I find myself needing this too for OSGeo4W, so I'll take care of it now.

comment:7 Changed 11 years ago by warmerdam

Milestone: 1.6.01.5.3
Resolution: fixed
Status: newclosed

I have made changes so that on win32 and Unix the plugin is built as gdal_ECW_JP2ECW.dll/so. I also added a new GDALRegister_ECW_JP2ECW() registration function. So when the plugin is loaded both drivers now get registered by default.

Changes are in trunk (r14743, r14745) and 1.5 branch (r14744, r14746).

The fixes will appear first in GDAL 1.5.3.

Note: See TracTickets for help on using tickets.