from typing import Dict
from pathlib import Path


def read_image_to_bytes(filename: str) -> Dict:
    """
    Function that reads in a video file as a bytes array

    Parameters
    ----------
    filename : str
        Path to image file

    Returns
    -------
    JSON
        Object containing "filename" and bytes array
    """

    with open(filename, "rb") as file:
        bytes_array = file.read()

    file_info = {}
    file_info["filename"] = Path(filename).stem
    file_info["data"] = bytes_array

    return file_info