(self, filename)
return mimetype.startswith("image/")
Returns true if the filename has an image extension.
Returns true if the filename has an image extension.
Returns true if the filename has an image extension .
def IsImage(self, filename):
    """Returns true if the filename has an image extension."""
    mimetype =  mimetypes.guess_type(filename)[0]
    if not mimetype:
      return False
    return mimetype.startswith("image/")
def IsImage ( self , filename ) : mimetype = mimetypes . guess_type ( filename ) [ 0 ] if not mimetype : return False return mimetype . startswith ( "image/" )