def GetFileExt(path, add_dot=False):
    """ Returns the filetype extension from the given file path.

    :param str path: file path
    :param boolean add_dot: whether to append a period/dot to the returned extension
    :returns str: filetype extension (e.g: png)
    """
    ext = path.split(".")
    ext.reverse()
    if add_dot == True:
        return ".{}".format(ext[0])
    else:
        return ext[0]