import base64


def convert_image_file_to_b64_string(filename):
    """ Get the b64 string for a selected image file

    As a tool function, simply take the filename(of an image)
    that the user wants to convert, open that file,
    read it and turns it into a corresponding b64 string

    Args:
        str: the name of which file the user wants to convert

    Returns:
          The wanted b64 string for an image with a predetermined
          filename
    """
    with open(filename, "rb") as image_file:
        b64_bytes = base64.b64encode(image_file.read())
    b64_string = str(b64_bytes, encoding="utf-8")
    return b64_string