              return
          logger.debug("Displaying preview: %s", self._previewcache["filenames"])
          self._previewoutput = (show_image, ImageTk.PhotoImage(show_image))
  
      def _get_newest_filenames(self, image_files):
          """ Return image filenames that have been modified since the last check.
  
          Parameters
          ----------
          image_files: list
 
</s> remove         self._gui_objects["default_options"] = default
 </s> add         self._gui_objects.default_options = default </s> remove             if img.size[0] != img.size[1]:
                # Pad to square
                new_img = Image.new("RGB", (thumbnail_size, thumbnail_size))
                new_img.paste(img, ((thumbnail_size - img.size[0])//2,
                                    (thumbnail_size - img.size[1])//2))
                img = new_img
            draw = ImageDraw.Draw(img)
            draw.rectangle(((0, 0), (thumbnail_size, thumbnail_size)), outline="#E5E5E5", width=1)
            samples.append(np.array(img))

        samples = np.array(samples)
        if not np.any(samples):
 </s> add             samples.append(self._pad_and_border(img, thumbnail_size))

        return self._process_samples(samples,
                                     [fname for fname in show_files if fname not in dropped_files],
                                     num_images)

    def _pad_and_border(self, image: Image.Image, size: int) -> np.ndarray:
        """ Pad rectangle images to a square and draw borders

        Parameters
        ----------
        image: :class:`PIL.Image`
            The image to process
        size: int
            The size of the image as it should be displayed

        Returns
        -------
        :class:`PIL.Image`:
            The processed image
        """
        if image.size[0] != image.size[1]:
            # Pad to square
            new_img = Image.new("RGB", (size, size))
            new_img.paste(image, ((size - image.size[0]) // 2, (size - image.size[1]) // 2))
            image = new_img
        draw = ImageDraw.Draw(image)
        draw.rectangle(((0, 0), (size, size)), outline="#E5E5E5", width=1)
        retval = np.array(image)
        logger.trace("image shape: %s", retval.shape)  # type: ignore
        return retval

    def _process_samples(self,
                         samples: List[np.ndarray],
                         filenames: List[str],
                         num_images: int) -> bool:
        """ Process the latest sample images into a displayable image.

        Parameters
        ----------
        samples: list
            The list of extract/convert preview images to display
        filenames: list
            The full path to the filenames corresponding to the images
        num_images: int
            The number of images that should be displayed

        Returns
        -------
        bool
            ``True`` if samples succesfully compiled otherwise ``False``
        """
        asamples = np.array(samples)
        if not np.any(asamples): </s> remove     def previewtrain(self):
 </s> add     def previewtrain(self) -> Dict[str, List[Union[Image.Image, ImageTk.PhotoImage, None, float]]]: </s> remove     def _clear_image_cache(self):
 </s> add     def _clear_image_cache(self) -> None:
    def _get_newest_folder(self) -> str:
        """ Obtain the most recent folder created in the extraction output folder when processing
        in batch mode.

        Returns
        -------
        str
            The most recently modified folder within the parent output folder. If no folders have
            been created, returns the parent output folder

        """
        assert self._pathoutput is not None
        folders = [os.path.join(self._pathoutput, folder)
                   for folder in os.listdir(self._pathoutput)
                   if os.path.isdir(os.path.join(self._pathoutput, folder))]
        folders.sort(key=os.path.getmtime)
        retval = folders[-1] if folders else self._pathoutput
        logger.debug("sorted folders: %s, return value: %s", folders, retval)
        return retval

    def _get_newest_filenames(self, image_files: List[str]) -> List[str]:
              return
          logger.debug("Displaying preview: %s", self._previewcache["filenames"])
          self._previewoutput = (show_image, ImageTk.PhotoImage(show_image))
  
    def _get_newest_folder(self) -> str:
        """ Obtain the most recent folder created in the extraction output folder when processing
        in batch mode.

        Returns
        -------
        str
            The most recently modified folder within the parent output folder. If no folders have
            been created, returns the parent output folder

        """
        assert self._pathoutput is not None
        folders = [os.path.join(self._pathoutput, folder)
                   for folder in os.listdir(self._pathoutput)
                   if os.path.isdir(os.path.join(self._pathoutput, folder))]
        folders.sort(key=os.path.getmtime)
        retval = folders[-1] if folders else self._pathoutput
        logger.debug("sorted folders: %s, return value: %s", folders, retval)
        return retval

    def _get_newest_filenames(self, image_files: List[str]) -> List[str]:
          """ Return image filenames that have been modified since the last check.
  
          Parameters
          ----------
          image_files: list
keep keep keep keep replace keep keep keep keep keep
 Bugfix: Preview for extract in batch mode 
lib/gui/utils.py