def imgResize(img_size, dw):
    """Resize the image based on the default window width.

    Args:
        img_size (str): org image size.
        dw (int): Default window width.
    Returns:
        tuple: Adjusted image size.
    """
    img_size = img_size.split("x")
    x, y = img_size
    x, y = int(x), int(y)
    if x > y:
        new_x = min(x, dw)
        new_y = y * new_x // x
    else:
        new_y = min(y, dw)
        new_x = x * new_y // y
    return new_x, new_y