Opened 14 years ago

Closed 14 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


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 ( so it is apparently not irretrievably corrupt.

Originally this came up during investigation of #3409.

Change History (2)

comment:1 by warmerdam, 14 years ago

Status: newassigned

I see OpenCPN is using highly adapted GDAL code, particularly for the BSB reading, in src/chartimg.cpp (See ChartBaseBSB::BSBScanScanline() and nearby functions).

comment:2 by warmerdam, 14 years ago

Resolution: fixed
Status: assignedclosed

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.

Note: See TracTickets for help on using tickets.