summaryrefslogtreecommitdiff
path: root/src/lib/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util.cc')
-rw-r--r--src/lib/util.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 183ff7d8b..26dfa8bf7 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -775,3 +775,12 @@ LocaleGuard::~LocaleGuard ()
setlocale (LC_NUMERIC, _old);
free (_old);
}
+
+bool
+valid_image_file (boost::filesystem::path f)
+{
+ string ext = f.extension().string();
+ transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
+ return (ext == ".tif" || ext == ".tiff" || ext == ".jpg" || ext == ".jpeg" || ext == ".png" || ext == ".bmp");
+}
+