                  size = (framesize[0], int(displayimg.size[1] * scale))
              else:
                  scale = framesize[1] / float(displayimg.size[1])
                  size = (int(displayimg.size[0] * scale), framesize[1])
              logger.trace("Scaling: (scale: %s, size: %s", scale, size)
  
              # Hacky fix to force a reload if it happens to find corrupted
              # data, probably due to reading the image whilst it is partially
              # saved. If it continues to fail, then eventually raise.
              for i in range(0, 1000):
 
</s> remove         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
 </s> add         # Filter to just the gui_preview if it exists in folder output
        imagefiles = [gui_preview] if gui_preview in imagefiles else imagefiles
        logger.debug("Image Files: %s", len(imagefiles))

        imagefiles = self.get_newest_filenames(imagefiles)
        if not imagefiles: </s> remove         logger.trace("Resizing image: (name: '%s', framesize: %s", name, framesize)
 </s> add         logger.debug("Resizing image: (name: '%s', framesize: %s", name, framesize) </s> remove             self.previewoutput = None
 </s> add #            self.previewoutput = None </s> remove         logger.trace("Getting size: '%s'", name)
 </s> add         logger.debug("Getting size: '%s'", name) </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)
            logger.debug("Scaling: (scale: %s, size: %s", scale, size)
                  size = (framesize[0], int(displayimg.size[1] * scale))
              else:
                  scale = framesize[1] / float(displayimg.size[1])
                  size = (int(displayimg.size[0] * scale), framesize[1])
            logger.debug("Scaling: (scale: %s, size: %s", scale, size)
  
              # Hacky fix to force a reload if it happens to find corrupted
              # data, probably due to reading the image whilst it is partially
              # saved. If it continues to fail, then eventually raise.
              for i in range(0, 1000):
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