Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#2881 closed defect (fixed)

BSBDataset::open() function may consider a non-BSB file as a BSB file

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

Description

GDAL Version 1.6 When i use GDALOpen() to open an bmp file, GDAL reports a error message like this: "ERROR 1: Failed to find required RGB/ or BSB/ keyword in header." but I found that this is a BSB format errror message.

================================================================================== BSBDataset::open() {

if( poOpenInfo->nHeaderBytes < 1000 )

return NULL;

for( i = 0; i < poOpenInfo->nHeaderBytes - 4; i++ ) {

if( poOpenInfo->pabyHeader[i+0] == 'B'

&& poOpenInfo->pabyHeader[i+1] == 'S' && poOpenInfo->pabyHeader[i+2] == 'B' && poOpenInfo->pabyHeader[i+3] == '/' ) break;

if( poOpenInfo->pabyHeader[i+0] == 'N'

&& poOpenInfo->pabyHeader[i+1] == 'O' && poOpenInfo->pabyHeader[i+2] == 'S' && poOpenInfo->pabyHeader[i+3] == '/' )

{

isNos = true; break;

} if( poOpenInfo->pabyHeader[i+0] == 'W'

&& poOpenInfo->pabyHeader[i+1] == 'X' && poOpenInfo->pabyHeader[i+2] == '
' && poOpenInfo->pabyHeader[i+3] == '8' ) break;

}

} ==================================================================================== if the 1000 bytes in one file has a sequence "NOS/", the file is considered as a NOS file, but in fact, this is a bmp file and occasionally has a "NOS/" sequence in 1000 bytes

Attachments (1)

bb.bmp (768.1 KB ) - added by Kasulle 15 years ago.
a bmp file but considered as a NOS file by BSB driver

Download all attachments as: .zip

Change History (3)

by Kasulle, 15 years ago

Attachment: bb.bmp added

a bmp file but considered as a NOS file by BSB driver

comment:1 by Even Rouault, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in trunk (r16539) and in branches/1.6 (r16540). In the meantime you can workaround by skipping the BSB driver with the GDAL_SKIP configuration option :

GDAL_SKIP=BSB gdalinfo bb.bmp

in reply to:  1 comment:2 by Kasulle, 15 years ago

Replying to rouault:

Fixed in trunk (r16539) and in branches/1.6 (r16540). In the meantime you can workaround by skipping the BSB driver with the GDAL_SKIP configuration option :

GDAL_SKIP=BSB gdalinfo bb.bmp

thanks

Note: See TracTickets for help on using tickets.