Minor formatting and syntax fix.
[mediagoblin.git] / mediagoblin / submit / security.py
index db4c860de9729e30734c23d21ac0ad7a9e923ee6..6708baf75feadd91e67dff462752959e6183165e 100644 (file)
@@ -1,5 +1,5 @@
 # GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 Free Software Foundation, Inc
+# Copyright (C) 2011 MediaGoblin contributors.  See AUTHORS.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU Affero General Public License as published by
 
 from mimetypes import guess_type
 
-from Image import open as image_open
-
 ALLOWED = ['image/jpeg', 'image/png', 'image/tiff', 'image/gif']
 
-def check_filetype(posted_file):
-    if not guess_type(posted_file.filename) in ALLOWED:
-        return False
 
-    try:
-        image = image_open(posted_file.file)
-    except IOError:
+def check_filetype(posted_file):
+    if not guess_type(posted_file.filename)[0] in ALLOWED:
         return False
 
     return True