  class PreviewExtract(DisplayOptionalPage):  # pylint: disable=too-many-ancestors
      """ Tab to display output preview images for extract and convert """
  
      def display_item_set(self) -> None:
          """ Load the latest preview if available """
          logger.trace("Loading latest preview")  # type:ignore
          size = int(256 if self.command == "convert" else 128 * get_config().scaling_factor)
          if not self._preview.load_latest_preview(thumbnail_size=size,
 
</s> remove         size = 256 if self.command == "convert" else 128
        get_images().load_latest_preview(thumbnail_size=int(size * get_config().scaling_factor),
                                         frame_dims=(self.winfo_width(), self.winfo_height()))
        self.display_item = get_images().previewoutput
 </s> add         size = int(256 if self.command == "convert" else 128 * get_config().scaling_factor)
        if not self._preview.load_latest_preview(thumbnail_size=size,
                                                 frame_dims=(self.winfo_width(),
                                                             self.winfo_height())):
            logger.trace("Preview not updated")  # type:ignore
            return
        logger.debug("Preview loaded")
        self.display_item = True </s> remove         if not self.update_preview.get():
 </s> add         if not self._preview.load(): </s> remove         get_images().load_training_preview()
        self.display_item = get_images().previewtrain
 </s> add         logger.debug("Preview loaded")
        self.display_item = True </s> remove     def previewoutput(self) -> Tuple[Image.Image, ImageTk.PhotoImage]:
        """ Tuple: First item in the tuple is the extract or convert preview image
        (:class:`PIL.Image`), the second item is the image in a format that tkinter can display
        (:class:`PIL.ImageTK.PhotoImage`).
 </s> add     def buffer(self) -> PreviewBuffer:
        """ :class:`~lib.training.PreviewBuffer` The preview buffer for the training preview
        image. """
        return self._buffer

    def load(self) -> bool:
        """ Load the latest training preview image(s) from disk and add to :attr:`buffer` """
        logger.trace("Loading Training preview images")  # type:ignore
        image_files = _get_previews(self._cache_path)
        filename = next((fname for fname in image_files
                         if os.path.basename(fname) == TRAININGPREVIEW), "")
        if not filename:
            logger.trace("No preview to display")  # type:ignore
            return False
        try:
            modified = os.path.getmtime(filename)
            if modified <= self._modified:
                logger.trace("preview '%s' not updated. Current timestamp: %s, "  # type:ignore
                             "existing timestamp: %s", filename, modified, self._modified)
                return False

            logger.debug("Loading preview: '%s'", filename)
            img = cv2.imread(filename, cv2.IMREAD_UNCHANGED)
            self._modified = modified
            self._buffer.add_image(os.path.basename(filename), img)
            self._error_count = 0
        except ValueError:
            # This is probably an error reading the file whilst it's being saved so ignore it
            # for now and only pick up if there have been multiple consecutive fails
            logger.warning("Unable to display preview: (image: '%s', attempt: %s)",
                           img, self._error_count)
            if self._error_count < 10:
                self._error_count += 1
            else:
                logger.error("Error reading the preview file for '%s'", filename)
            return False
    def __init__(self, *args, **kwargs) -> None:
        logger.debug("Initializing %s (args: %s, kwargs: %s)",
                     self.__class__.__name__, args, kwargs)
        self._preview = get_images().preview_extract
        super().__init__(*args, **kwargs)
        logger.debug("Initialized %s", self.__class__.__name__)
  class PreviewExtract(DisplayOptionalPage):  # pylint: disable=too-many-ancestors
      """ Tab to display output preview images for extract and convert """
    def __init__(self, *args, **kwargs) -> None:
        logger.debug("Initializing %s (args: %s, kwargs: %s)",
                     self.__class__.__name__, args, kwargs)
        self._preview = get_images().preview_extract
        super().__init__(*args, **kwargs)
        logger.debug("Initialized %s", self.__class__.__name__)
  
      def display_item_set(self) -> None:
          """ Load the latest preview if available """
          logger.trace("Loading latest preview")  # type:ignore
          size = int(256 if self.command == "convert" else 128 * get_config().scaling_factor)
          if not self._preview.load_latest_preview(thumbnail_size=size,
keep add keep keep keep keep keep keep
 GUI - Preview updates
  - Training preview. Embed preview pop-out window
  - Bugfix - convert/extract previews 
lib/gui/display_command.py