                  logger.debug("Deleting: '%s'", fullitem)
                  os.remove(fullitem)
          self.clear_image_cache()
  
      def clear_image_cache(self):
          """ Clear all cached images """
          logger.debug("Clearing image cache")
 
</s> remove         logger.trace("Getting images: '%s'", imgpath)
 </s> add         logger.debug("Getting images: '%s'", imgpath) </s> remove         logger.trace("Getting size: '%s'", name)
 </s> add         logger.debug("Getting size: '%s'", name) </s> remove         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)
 </s> add         self.load_images_to_cache(imagefiles, frame_dims, thumbnail_size)
        if imagefiles == [gui_preview]:
            # Delete the preview image so that the main scripts know to output another
            logger.debug("Deleting preview image")
            os.remove(imagefiles[0])
        show_image = self.place_previews(frame_dims)
        logger.debug("Displaying preview: '%s'", self.previewcache["filenames"])
        for fname in self.previewcache["filenames"]:
            if os.path.basename(fname) == ".gui_preview.jpg":
                logger.debug("Deleting: '%s'", fname)
                try:
                    os.remove(fname)
                except FileNotFoundError:
                    logger.debug("File does not exist: %s", fname)
                  logger.debug("Deleting: '%s'", fullitem)
                  os.remove(fullitem)
        for fname in self.previewcache["filenames"]:
            if os.path.basename(fname) == ".gui_preview.jpg":
                logger.debug("Deleting: '%s'", fname)
                try:
                    os.remove(fname)
                except FileNotFoundError:
                    logger.debug("File does not exist: %s", fname)
          self.clear_image_cache()
  
      def clear_image_cache(self):
          """ Clear all cached images """
          logger.debug("Clearing image cache")
keep add 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