From afbc75845b7e88ae7311a0fb0065c6f0ca13eb2e Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 27 Aug 2011 22:24:04 +0300 Subject: [PATCH] Use FS::extpart for checking filename extension --- source/graphics/image.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.45.2