Ticket #2320 (closed defect: fixed)

Opened 3 months ago

Last modified 1 month ago

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

Reported by: nsavard Assigned to: 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

05/16/08 14:13:22 changed by rouault

  • status changed from new to closed.
  • resolution set to invalid.
  • milestone deleted.

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.

05/16/08 14:30:20 changed by warmerdam

  • keywords set to ECW JP2ECW.
  • status changed from closed to reopened.
  • resolution deleted.
  • milestone set to 1.6.0.

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.

05/16/08 14:31:29 changed by warmerdam

  • status changed from reopened to new.
  • owner changed from warmerdam to mloskot.
  • cc set to warmerdam.

05/22/08 14:22:23 changed by rouault

#2385 depends on this ticket.

06/10/08 04:00:48 changed by frankie

  • cc changed from warmerdam to warmerdam, frankie.

06/21/08 01:04:48 changed by warmerdam

  • owner changed from mloskot to warmerdam.
  • cc changed from warmerdam, frankie to frankie.

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

06/21/08 03:08:37 changed by warmerdam

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone changed from 1.6.0 to 1.5.3.

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.