def __get_image_size(width, height):
        """
        Returns new image sizes such that the image fits inside a 600x300 bounding box.
        If the image already fits inside that box then the original size is returned.
        """
        MAX_WIDTH = 1200.0
        MAX_HEIGHT = 400.0
        if width > MAX_WIDTH:
            resize_ratio = MAX_WIDTH / width
            width *= resize_ratio
            height *= resize_ratio
        if height > MAX_HEIGHT:
            resize_ratio = MAX_HEIGHT / height
            width *= resize_ratio
            height *= resize_ratio
        return width, height

        Returns new image sizes such that the image fits inside a 600x300 bounding box.
        If the image already fits inside that box then the original size is returned.
        
docs/_ext/autorobusta.py