Skip to content

Commit 97b6298

Browse files
author
jef
committed
apply #2251
git-svn-id: http://svn.osgeo.org/qgis/trunk@12410 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent cb0fcfd commit 97b6298

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

src/core/raster/qgsrasterlayer.cpp

+17-9
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void QgsRasterLayer::buildSupportedRasterFileFilter( QString & theFileFiltersStr
294294

295295
// Grind through all the drivers and their respective metadata.
296296
// We'll add a file filter for those drivers that have a file
297-
// extension defined for them; the others, welll, even though
297+
// extension defined for them; the others, well, even though
298298
// theoreticaly we can open those files because there exists a
299299
// driver for them, the user will have to use the "All Files" to
300300
// open datasets with no explicitly defined file name extension.
@@ -319,7 +319,7 @@ void QgsRasterLayer::buildSupportedRasterFileFilter( QString & theFileFiltersStr
319319

320320
myGdalDriverDescription = GDALGetDescription( myGdalDriver );
321321

322-
// QgsDebugMsg(QString("got driver string %1").arg(myGdalDriverDescription));
322+
// QgsDebugMsg(QString("got driver string %1").arg(myGdalDriverDescription));
323323

324324
myGdalDriverMetadata = GDALGetMetadata( myGdalDriver, NULL );
325325

@@ -328,7 +328,7 @@ void QgsRasterLayer::buildSupportedRasterFileFilter( QString & theFileFiltersStr
328328
while ( myGdalDriverMetadata && '\0' != myGdalDriverMetadata[0] )
329329
{
330330
metadataTokens = QString( *myGdalDriverMetadata ).split( "=", QString::SkipEmptyParts );
331-
// QgsDebugMsg(QString("\t%1").arg(*myGdalDriverMetadata));
331+
// QgsDebugMsg(QString("\t%1").arg(*myGdalDriverMetadata));
332332

333333
// XXX add check for malformed metadataTokens
334334

@@ -365,13 +365,21 @@ void QgsRasterLayer::buildSupportedRasterFileFilter( QString & theFileFiltersStr
365365
if ( myGdalDriverDescription == "JPEG2000" ||
366366
myGdalDriverDescription.startsWith( "JP2" ) ) // JP2ECW, JP2KAK, JP2MrSID
367367
{
368-
if ( !jp2Driver )
369-
{
370-
jp2Driver = myGdalDriver; // first JP2 driver found
371-
glob += " *.j2k"; // add alternate extension
372-
}
373-
else break; // skip if already found a JP2 driver
368+
if ( jp2Driver )
369+
break; // skip if already found a JP2 driver
370+
371+
jp2Driver = myGdalDriver; // first JP2 driver found
372+
glob += " *.j2k"; // add alternate extension
373+
}
374+
else if ( myGdalDriverDescription == "GTiff" )
375+
{
376+
glob += " *.tiff";
377+
}
378+
else if ( myGdalDriverDescription == "JPEG" )
379+
{
380+
glob += " *.jpeg";
374381
}
382+
375383
theFileFiltersString += myGdalDriverLongName + " (" + glob.toLower() + " " + glob.toUpper() + ");;";
376384

377385
break; // ... to next driver, if any.

0 commit comments

Comments
 (0)