          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)
              width, height = img.size
              scaling = thumbnail_size / max(width, height)
 
</s> remove         logger.trace("num_images: %s", num_images)
 </s> add         logger.debug("num_images: %s", num_images) </s> remove         logger.trace("cols: %s, rows: %s", cols, rows)
 </s> add         logger.debug("cols: %s, rows: %s", cols, rows)
        remainder = (cols * rows) % num_images
        if remainder != 0:
            logger.debug("Padding final row. Remainder: %s", remainder)
            placeholder = np.concatenate([np.expand_dims(self.previewcache["placeholder"],
                                                         0)] * remainder)
            samples = np.concatenate((samples, placeholder)) </s> remove         logger.trace("num_images: %s, thumbnail_size: %s", num_images, thumbnail_size)
 </s> add         if self.previewcache["placeholder"] is None:
            self.create_placeholder(thumbnail_size)

        logger.debug("num_images: %s, thumbnail_size: %s", num_images, thumbnail_size) </s> remove     @staticmethod
    def place_previews(samples, frame_dims):
 </s> add     def place_previews(self, frame_dims): </s> remove         if not imagefiles or len(imagefiles) == 1:
 </s> add         gui_preview = os.path.join(self.pathoutput, ".gui_preview.jpg")
        if not imagefiles or (len(imagefiles) == 1 and gui_preview not in imagefiles):
        logger.debug("start_idx: %s, end_idx: %s", start_idx, end_idx)
          logger.trace("num_images: %s", num_images)
          samples = list()
          start_idx = len(imagefiles) - (num_images + 1)
          end_idx = len(imagefiles) - 1
        logger.debug("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)
              width, height = img.size
              scaling = thumbnail_size / max(width, height)
keep keep keep keep replace keep keep keep keep keep
 GUI: Preview for convert

Display preview when outputting to a stream container (e.g. video, gif) 
lib/gui/utils.py