def _make_concatenation(self):
        """
        depending on activated flags different combination of scripts is called
        """
        file_names = self.lstbox.get(0, tk.END)
        if len(file_names) < 2: return

        image_list = [Image.open(e) for e in file_names]

        if self.bs_resize.variable:
            if self.bs_concat.variable:
                max_width = MergerScripts.find_max_width(image_list)
                image_list = MergerScripts.resize_all_tomax(image_list,
                                                            max_width,
                                                            Image,
                                                            is_vertical=True)
            else:
                max_height = MergerScripts.find_max_height(image_list)
                image_list = MergerScripts.resize_all_tomax(image_list,
                                                            max_height,
                                                            Image,
                                                            is_vertical=False)

        if self.bs_concat.variable:
            result_image = MergerScripts.concatenate_v(image_list,
                                                       self.bg_color, Image)
        else:
            result_image = MergerScripts.concatenate_h(image_list,
                                                       self.bg_color, Image)

        _path = self.direntry.variable
        _path = MergerScripts.make_default_concatenation_path(_path)
        self.direntry.variable = _path
        result_image.save(f'{self.direntry.variable}', 'PNG')
 def test_resize_all_tomax(self):
     expected = 256
     actual = MergerScripts.resize_all_tomax(self.images, 256, Image,
                                             True)[1].width
     assert expected == actual