import re


def correct_filename(filename):
    """Out a .png suffix to the passed filename if necessary."""
    p = re.compile(".*\\.png", re.IGNORECASE)

    if not p.match(filename):
        filename += ".png"

    return filename