Opened 13 years ago
Closed 13 years ago
#3776 closed defect (fixed)
Unreadable Swedish BSB file is readable with OpenCPN
Reported by: | warmerdam | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | GDAL_Raster | Version: | unspecified |
Severity: | normal | Keywords: | BSB |
Cc: | chrisbarker, manimaul, hamish |
Description
The BSB file in:
is not readable with GDAL. It errors out at line 128. (tested with 1.5, 1.6, 1.7 and trunk) The same file works ok with OpenCPN (http://www.opencpn.org/) so it is apparently not irretrievably corrupt.
Originally this came up during investigation of #3409.
Change History (2)
comment:1 by , 13 years ago
Status: | new → assigned |
---|
comment:2 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I have come to the conclusion that the folks who produced this file just didn't understand how to properly encode the line numbers. I have found the image reads just fine if you ignore the line numbers being wrong.
However, I am not really willing to ignore line number errors in general, as they seem like one of the few mechanisms to discover if a file is corrupt. So I'm leaving this as an error, but providing a configuration option, BSB_IGNORE_LINENUMBERS, that will ignore problems with the line numbers. The original error message mentions this option now. If such files prove to be common we may want to alter the behavior.
An inspection of OpenCPN code shows that line numbers are not checked which is why it works fine.
The "fix" is r20803 in trunk.
I see OpenCPN is using highly adapted GDAL code, particularly for the BSB reading, in src/chartimg.cpp (See ChartBaseBSB::BSBScanScanline() and nearby functions).