Example #1
0
    def test_resize_image(self):
        image_tools = ImageTools()
        file_path = './test/resources/org_image.jpg'
        result_folder = './test/resources/results'
        image_tools.resize_image(1920, 1080, file_path, 0, result_folder)

        #Test width is now 1920
        result_width = self.get_image_width('./test/resources/results/frame_00000.jpg')
        self.assertEqual(1920, result_width)

        #Test height is now 1080
        result_height = self.get_image_height('./test/resources/results/frame_00000.jpg')
        self.assertEqual(1080, result_height)
Example #2
0
def convert_images(filenames):
    image_tools = ImageTools()

    # Obtain Environment
    src_folder = project_config.get("Locations", "source_folder")
    target_folder = project_config.get("Locations", "target_folder")

    # Obtain Target Resolution
    target_width = project_config.get("ImageConversion", "resolution_width")
    target_height = project_config.get("ImageConversion", "resolution_height")

    for index, filename in enumerate(filenames):
        file_path = src_folder + "/" + filename
        image_tools.resize_image(target_width, target_height, file_path, index, target_folder)