Opened 11 years ago

Closed 11 years ago

#4058 closed defect (duplicate)

it's failed to open the renameed ige file in GDAL hfa。

Reported by: liminlu0314 Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: 1.8.0
Severity: normal Keywords: hfa ige
Cc:

Description

it's failed to open the renameed ige file in GDAL hfa。 this file can be open by ArcMap or Erdas. modify the file can be solve this problem:

modify gdal src\frmts\hfa\hfaband.cpp line 367 like this:

	/* -------------------------------------------------------------------- */ 
	/*      Open raw data file.                                             */ 
	/* -------------------------------------------------------------------- */   
	const char *pszRawFilename = poDMS->GetStringField( "fileName.string" );  
	const char *pszFullFilename; 
	
	pszFullFilename = CPLFormFilename( psInfo->pszPath, pszRawFilename, NULL );   
	
	if( psInfo->eAccess == HFA_ReadOnly )  
		fpExternal = VSIFOpenL( pszFullFilename, "rb" );  
	else        
		fpExternal = VSIFOpenL( pszFullFilename, "r+b" );   

	if( fpExternal == NULL )   
	{       
		CPLString strFileName = psInfo->pszFilename;  
		strFileName = strFileName.substr(strFileName.find_last_of('.')+1) + "ige";  
		 
		pszFullFilename = CPLFormFilename( psInfo->pszPath, strFileName.c_str(), NULL );      
		
		if( psInfo->eAccess == HFA_ReadOnly )             
			fpExternal = VSIFOpenL( pszFullFilename, "rb" );   
		else      
			fpExternal = VSIFOpenL( pszFullFilename, "r+b" );       

		if( fpExternal == NULL )  
		{          
			CPLError( CE_Failure, CPLE_OpenFailed, "Unable to open external data file:\n%s\n", pszFullFilename );
			return CE_Failure;       
		}     
		 
		psInfo->pszIGEFilename = VSIStrdup(strFileName.c_str()); //malloc   
	}

Change History (1)

comment:1 by Even Rouault, 11 years ago

Resolution: duplicate
Status: newclosed

Looks like a duplicate of #3897 whose latest fixes should be in 1.8.1 I believe.

Note: See TracTickets for help on using tickets.