def METHOD_NAME(size_limit: int, filename: str) -> None:
    """
    Verifies the given image file does not exceed the size limit.
    Throws an exception if the limit is exceeded. If the size limit
    is set to None no verification is done.
    :param int size_limit: The size limit for filename in bytes.
    :param str filename: File to verify.
    :raises KiwiResultError: if filename exceeds the size limit
    """
    if size_limit is not None:
        if os.path.getsize(filename) > size_limit:
            raise KiwiResultError(
                'Build constraint failed: {0} is bigger than {1}'
                .format(filename, size_limit)
            )