Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#4651 closed defect (fixed)

MrSID driver, JPEG2000 format files and world files

Reported by: jnovak Owned by: warmerdam
Priority: normal Milestone: 1.10.0
Component: default Version: 1.8.1
Severity: normal Keywords: MrSID JPEG2000
Cc:

Description

I have found that the existing MrSID gdal driver will ignore j2w files for geotransform information if present with JPEG2000 formatted files.

While symlinking the j2w files to sdw is an option, adding code to look for and use a j2w files is simple and seemingly useful.

To apply the attached patch, cd to the mrsid driver directory (frmts/mrsid) and run

patch mrsiddataset.cpp < mrsid.patch

Attachments (1)

mrsid.patch (572 bytes ) - added by jnovak 12 years ago.
Patch to enable read of j2w files

Download all attachments as: .zip

Change History (7)

by jnovak, 12 years ago

Attachment: mrsid.patch added

Patch to enable read of j2w files

comment:1 by Even Rouault, 12 years ago

Milestone: 2.0.0
Resolution: fixed
Status: newclosed

r24375 /trunk/gdal/frmts/ (4 files in 4 dirs): Add support for reading .j2w, .jp2w and .wld files for JP2ECW, JP2MrSID, JP2OPENJPEG and JPEG2000 drivers (#4651)

comment:2 by Even Rouault, 12 years ago

r24376 /trunk/autotest/gdrivers/ (ecw.py jp2openjpeg.py jpeg2000.py mrsid.py): Test support for reading .j2w for JP2ECW, JP2MrSID, JP2OPENJPEG and JPEG2000 drivers (#4651)

r24377 /trunk/autotest/gdrivers/data/ (byte_without_geotransform.j2w byte_without_geotransform.jp2): Add test data (#4651)

comment:3 by Even Rouault, 12 years ago

r24383 /trunk/gdal/gcore/gdal_priv.h: Fix r24375 that broke building of ECW or MrSID drivers as plugins (#4651)

comment:4 by AlexNI, 11 years ago

Is the bug fixed? The ECW and MrSID drivers do ignore the j2w in 1.10.1! But NEWS of 1.10.0 tell that Multi driver changes:

  • Add support for reading .j2w, .jp2w and .wld files for JP2ECW, JP2MrSID, JP2OPENJPEG and JPEG2000 drivers (#4651)

comment:5 by Even Rouault, 11 years ago

Can you demonstrate this with a sample ? The fix is tested in the autotest suite and I've just manually verified it works :

$ gdalinfo ../autotest/gdrivers/data/byte_without_geotransform.jp2
Driver: JP2ECW/ERDAS JPEG2000 (SDK 5.0)
Files: ../autotest/gdrivers/data/byte_without_geotransform.jp2
       ../autotest/gdrivers/data/byte_without_geotransform.j2w
Size is 20, 20
Coordinate System is `'
Origin = (440720.000000000000000,3751320.000000000000000)
Pixel Size = (60.000000000000000,-60.000000000000000)
Metadata:
  COLORSPACE=GREYSCALE
  COMPRESSION_RATE_TARGET=2
  VERSION=1
Corner Coordinates:
Upper Left  (  440720.000, 3751320.000) 
Lower Left  (  440720.000, 3750120.000) 
Upper Right (  441920.000, 3751320.000) 
Lower Right (  441920.000, 3750120.000) 
Center      (  441320.000, 3750720.000) 
Band 1 Block=256x256 Type=Byte, ColorInterp=Gray
  Description = Grayscale
  Overviews: arbitrary
$ GDAL_SKIP="JP2ECW JP2OPENJPEG JPEG2000" gdalinfo ../autotest/gdrivers/data/byte_without_geotransform.jp2
Driver: JP2MrSID/MrSID JPEG2000
Files: ../autotest/gdrivers/data/byte_without_geotransform.jp2
       ../autotest/gdrivers/data/byte_without_geotransform.j2w
Size is 20, 20
Coordinate System is `'
Origin = (440720.000000000000000,3751320.000000000000000)
Pixel Size = (60.000000000000000,-60.000000000000000)
Corner Coordinates:
Upper Left  (  440720.000, 3751320.000) 
Lower Left  (  440720.000, 3750120.000) 
Upper Right (  441920.000, 3751320.000) 
Lower Right (  441920.000, 3750120.000) 
Center      (  441320.000, 3750720.000) 
Band 1 Block=20x20 Type=Byte, ColorInterp=Gray
  Minimum=128.000, Maximum=240.000, Mean=130.600, StdDev=13.156
  Metadata:
    STATISTICS_MAXIMUM=240
    STATISTICS_MEAN=130.6
    STATISTICS_MINIMUM=128
    STATISTICS_STDDEV=13.155987230155

comment:6 by AlexNI, 11 years ago

Ups, very sorry for disturbing! Woks for me as well.

Note: See TracTickets for help on using tickets.