lib/utils.py
changeset 23 10841abbc01f
parent 20 6c774496bb00
child 26 81d6679d50d0
--- a/lib/utils.py	Wed Jan 16 18:44:03 2008 +0000
+++ b/lib/utils.py	Thu Jan 17 01:56:04 2008 +0000
@@ -20,6 +20,19 @@
 
 import os.path
 
+import settings
+
+def isImage (fname) :
+    """
+        Is the given filename likely to be an image file?
+    """
+
+    fname = fname.lower()
+    base, ext = os.path.splitext(fname)
+    ext = ext.lstrip('.')
+
+    return ext in settings.IMAGE_EXTS
+
 def readFile (path) :
     fo = open(path, 'r')
     data = fo.read()