summaryrefslogtreecommitdiff
path: root/indra/llimage/llimagetga.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llimage/llimagetga.cpp')
-rw-r--r--indra/llimage/llimagetga.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp
index a9fc02bf8d..c8689f6669 100644
--- a/indra/llimage/llimagetga.cpp
+++ b/indra/llimage/llimagetga.cpp
@@ -30,6 +30,7 @@
#include "linden_common.h"
+#include "lldir.h"
#include "llimagetga.h"
#include "llerror.h"
#include "llmath.h"
@@ -90,7 +91,7 @@ LLImageTGA::LLImageTGA()
{
}
-LLImageTGA::LLImageTGA(const LLString& file_name)
+LLImageTGA::LLImageTGA(const std::string& file_name)
: LLImageFormatted(IMG_CODEC_TGA),
mColorMap( NULL ),
mColorMapStart( 0 ),
@@ -1136,7 +1137,7 @@ BOOL LLImageTGA::decodeAndProcess( LLImageRaw* raw_image, F32 domain, F32 weight
}
// Reads a .tga file and creates an LLImageTGA with its data.
-bool LLImageTGA::loadFile( const LLString& path )
+bool LLImageTGA::loadFile( const std::string& path )
{
S32 len = path.size();
if( len < 5 )
@@ -1144,14 +1145,13 @@ bool LLImageTGA::loadFile( const LLString& path )
return false;
}
- LLString extension = path.substr( len - 4, 4 );
- LLString::toLower(extension);
- if( ".tga" != extension )
+ std::string extension = gDirUtilp->getExtension(path);
+ if( "tga" != extension )
{
return false;
}
- LLFILE* file = LLFile::fopen(path.c_str(), "rb"); /* Flawfinder: ignore */
+ LLFILE* file = LLFile::fopen(path, "rb"); /* Flawfinder: ignore */
if( !file )
{
llwarns << "Couldn't open file " << path << llendl;