def get_box4ratio_cut(width, height, ratio, center=None):
    """
    Give the edges of the image to have the correct ratio by cutting
    material
    Can be centered on a specific place of the image
    """
    if center is None:
        center = (int(width / 2), int(height / 2))

    x, y = width, height

    if int(x * ratio[1] - y * ratio[0]) == 0:
        return None
    elif int(x * ratio[1] - y * ratio[0]) > 0:
        new_width = y * (ratio[0] / ratio[1])
        return (
            int(center[0] - new_width / 2),
            0,
            int(center[0] + new_width / 2),
            height,
        )
    else:
        new_height = x * (ratio[1] / ratio[0])
        return (
            0,
            int(center[1] - new_height / 2),
            height,
            int(center[1] + new_height / 2),
        )