Opened 16 years ago

Closed 13 years ago

#2239 closed defect (fixed)

EHdr driver incorrectly identifies the file containing raw data

Reported by: dron Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

I have a directory containing the following list of files (MrSID DSDK data samples):

meg_cr20.bip
meg_cr20.hdr
meg_cr20.jp2
meg_cr20.jpg
meg_cr20.raw
meg_cr20.sid
meg_cr20.tif

When trying to read meg_cr20.jp2 or meg_cr20.sid GDAL tries to interpret them as being in EHdr/ESRI format with the meg_cr20.hdr being a header:

LAYOUT BIP
NROWS 480
NCOLS 640
NBANDS 3
NBITS 8
ULXMAP 0.000000000000000
ULYMAP 479.000000000000000
XDIM 1.000000000000000
YDIM 1.000000000000000

I have tried (successfully) to fix this with r13820 in trunk, but maybe it should be reverted and the driver fixed instead.

Best regards, Andrey

Change History (2)

comment:1 by Even Rouault, 16 years ago

Andrey, I don't really see any other solution than yours. The EHdr/ESRI driver has behaved rightly. It was given a file (.jp2 or .sid) that was accompanied by a valid .hdr file, so its behaviour is to assume that this .jp2 file is the raw data file associated with the header. And as there is no typical binary signature in the raw data file itself, there's no way to tell the driver not to handle the dataset, except if another driver can recognize the dataset... So, this driver is not very discriminative, and cannot be IMHO.

comment:2 by Even Rouault, 13 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.