From: Mikko Rasa Date: Sat, 27 Aug 2011 19:24:04 +0000 (+0300) Subject: Use FS::extpart for checking filename extension X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=afbc75845b7e88ae7311a0fb0065c6f0ca13eb2e;p=libs%2Fgui.git Use FS::extpart for checking filename extension --- diff --git a/source/graphics/image.cpp b/source/graphics/image.cpp index 6a20178..5d2a21b 100644 --- a/source/graphics/image.cpp +++ b/source/graphics/image.cpp @@ -1,6 +1,7 @@ #ifdef WITH_DEVIL #include #endif +#include #include #include #include "image.h" @@ -46,8 +47,9 @@ Image::~Image() void Image::load_file(const string &fn) { + string ext = FS::extpart(fn); #ifdef WITH_LIBPNG - if(fn.size()>4 && !fn.compare(fn.size()-4, 4, ".png")) + if(ext==".png") { IO::BufferedFile file(fn); load_png(file, *priv);