def test_premium_tier(self) -> None: """ Tests the rendering of the premium tier on the title bar. :return: None """ self.images.extend(process_images(title="Test Premium Tier", tier="premium"))
def test_logo_blue(self) -> None: """ Tests the rendering of the blue logo while also testing the color detection algorithm. :return: None """ self.images.extend(process_images(title="Test Blue Logo", logo_path=VF_ICON_PATH))
def test_free_tier(self) -> None: """ Tests the rendering of the free tier on the title bar. :return: None """ self.images.extend(process_images(title="Test Free Tier", tier="free"))
def test_red_logo(self) -> None: """ Tests the rendering of a logo. :return: None """ self.images.extend(process_images(title="Test Red Logo", logo_path=TRC_ICON_PATH))
def test_custom_font_strange_height(self) -> None: """ Tests the vertical alignment of the text placement algorithm for customs fonts with a strange height. :return: None """ self.images.extend(process_images(title="Test Custom Font Strange Height", font=CUSTOM_FONT_TALL)) self.assertEqual(1, len(self.images))
def test_custom_font(self) -> None: """ Tests the rendering of a custom font on the title bar. :return: None """ self.images.extend(process_images(title="Test Custom Font", font=CUSTOM_FONT)) self.assertEqual(1, len(self.images))
def test_one_line_title(self) -> None: """ Tests that the split text algorithm properly handles single term titles. :return: None """ self.images.extend(process_images(title="TestSingleLineFile")) self.assertEqual(1, len(self.images))
def test_many_images(self) -> None: """ Tests the batch processing feature. :return: None """ self.images.extend(process_images(path=IMAGE_FOLDER, batch=True)) self.assertEqual(len(TEST_IMAGES), len(self.images))
def test_one_image(self) -> None: """ Tests the single image processing feature. :return: None """ self.images.extend(process_images(path=DEFAULT_IMAGE)) self.assertEqual(1, len(self.images))
def test_zero_images(self) -> None: """ Tests that a default image is properly returned when no files are passed. :return: None """ self.images.extend(process_images()) self.assertEqual(1, len(self.images))
def main() -> None: """ The main function. :return: None """ args = vars(parse_input()) images = process_images(**args) save_copies(images, **args)
def _render_preview(self) -> None: """ Renders a preview of the edited image in the child preview pane. :return: None """ self.menu.current_edit = process_images(**self.options) maxsize = (1028, 1028) small_image = self.menu.current_edit[0].copy() small_image.thumbnail(maxsize, Image.Resampling.LANCZOS) image = ImageTk.PhotoImage(small_image) self.preview.config(image=image) self.preview.image = image