def calculate_width(size: tuple[int, int], pixel_height: int) -> int:
    """ Calculates width according to height to keep the aspect ratio. """
    original_width, original_height = size
    height_ratio = pixel_height / original_height
    return round(original_width * height_ratio, None)