          return files
  
      def load_latest_preview(self):
          """ Load the latest preview image for extract and convert """
          logger.trace("Loading preview image")
          imagefiles = self.get_images(self.pathoutput)
          if not imagefiles or len(imagefiles) == 1:
              logger.debug("No preview to display")
              self.previewoutput = None
              return
 
</s> remove     def load_latest_preview(self):
 </s> add     def load_latest_preview(self, thumbnail_size, frame_dims): </s> remove         # Get penultimate file so we don't accidentally
        # load a file that is being saved
        show_file = sorted(imagefiles, key=os.path.getctime)[-2]
        img = Image.open(show_file)
        img.thumbnail((768, 432))
        logger.trace("Displaying preview: '%s'", show_file)
        self.previewoutput = (img, ImageTk.PhotoImage(img))
 </s> add         logger.trace("Image Files: %s", len(imagefiles))
        num_images = (frame_dims[0] // thumbnail_size) * (frame_dims[1] // thumbnail_size)
        if num_images > len(imagefiles):
            logger.debug("Not enough images to generate display. (to display: %s, available "
                         "images: %s)", num_images, len(imagefiles))
            self.previewoutput = None
            return
        filenames, samples = self.get_preview_samples(imagefiles, num_images, thumbnail_size)
        show_image = self.place_previews(samples, frame_dims)
        logger.trace("Displaying preview: '%s'", filenames)
        self.previewoutput = (show_image, ImageTk.PhotoImage(show_image))

    @staticmethod
    def get_preview_samples(imagefiles, num_images, thumbnail_size):
        """ Return a subset of the imagefiles images
            Exclude final file so we don't accidentally load a file that is being saved """
        logger.trace("num_images: %s", num_images)
        samples = list()
        start_idx = len(imagefiles) - (num_images + 1)
        end_idx = len(imagefiles) - 1
        logger.trace("start_idx: %s, end_idx: %s", start_idx, end_idx)
        show_files = sorted(imagefiles, key=os.path.getctime)[start_idx: end_idx]
        for fname in show_files:
            img = Image.open(fname)
            img.thumbnail((thumbnail_size, thumbnail_size))
            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
            samples.append(np.array(img))
        samples = np.array(samples)
        logger.trace("Samples shape: %s", samples.shape)
        return show_files, samples

    @staticmethod
    def place_previews(samples, frame_dims):
        """ Stack the preview images to fit display """
        num_images, thumbnail_size = samples.shape[:2]
        logger.trace("num_images: %s, thumbnail_size: %s", num_images, thumbnail_size)
        cols, rows = frame_dims[0] // thumbnail_size, frame_dims[1] // thumbnail_size
        logger.trace("cols: %s, rows: %s", cols, rows)
        display = np.vstack([np.hstack(samples[row * cols: (row + 1) * cols])
                             for row in range(rows)])
        logger.trace("display shape: %s", display.shape)
        return Image.fromarray(display) </s> remove         get_images().load_latest_preview()
 </s> add         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())) </s> remove     def extract_tabs(self):
 </s> add     def extract_tabs(self, command="extract"): </s> remove         PreviewExtract(self, "preview", helptext, 5000)
 </s> add         PreviewExtract(self, "preview", helptext, 5000, command)
        logger.trace("Loading preview image: (thumbnail_size: %s, frame_dims: %s)",
                     thumbnail_size, frame_dims)
          return files
  
      def load_latest_preview(self):
          """ Load the latest preview image for extract and convert """
        logger.trace("Loading preview image: (thumbnail_size: %s, frame_dims: %s)",
                     thumbnail_size, frame_dims)
          imagefiles = self.get_images(self.pathoutput)
          if not imagefiles or len(imagefiles) == 1:
              logger.debug("No preview to display")
              self.previewoutput = None
              return
keep keep keep keep replace keep keep keep keep keep
 GUI: Show more previews for extract and convert 
lib/gui/utils.py