                  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
 
</s> remove             img.thumbnail((thumbnail_size, thumbnail_size))
 </s> add             width, height = img.size
            scaling = thumbnail_size / max(width, height)
            logger.debug("image width: %s, height: %s, scaling: %s", width, height, scaling)
            img = img.resize((int(width * scaling), int(height * scaling))) </s> remove         print(right, left, bottom, top)
 </s> add  </s> remove         ffm.run()
 </s> add         # Sometimes ffmpy exits for no discernible reason, but then works on a later attempt,
        # so take 5 shots at this
        attempts = 5
        for attempt in range(attempts):
            logger.debug("Muxing attempt: %s", attempt + 1)
            try:
                ffm.run()
            except FFRuntimeError as err:
                logger.debug("ffmpy runtime error: %s", str(err))
                if attempt != attempts - 1:
                    continue
                logger.error("There was a problem muxing audio. The output video has been "
                             "created but you will need to mux audio yourself either with the "
                             "EFFMpeg tool or an external application.")
                os.rename(self.video_tmp_file, self.video_file)
            break </s> remove from PIL import Image, ImageTk
 </s> add from PIL import Image, ImageDraw, ImageTk </s> remove         os.remove(self.video_tmp_file)
 </s> add         if os.path.isfile(self.video_tmp_file):
            os.remove(self.video_tmp_file)
            draw = ImageDraw.Draw(img)
            draw.rectangle(((0, 0), (thumbnail_size, thumbnail_size)), outline="#E5E5E5", width=1)
                  new_img.paste(img, ((thumbnail_size - img.size[0])//2,
                                      (thumbnail_size - img.size[1])//2))
                  img = new_img
            draw = ImageDraw.Draw(img)
            draw.rectangle(((0, 0), (thumbnail_size, thumbnail_size)), outline="#E5E5E5", width=1)
              samples.append(np.array(img))
          samples = np.array(samples)
          logger.trace("Samples shape: %s", samples.shape)
          return show_files, samples
  
      @staticmethod
keep keep add keep keep keep keep keep keep
 Fixups

GUI: Fix thumbnail calculation + add borders
cv2-dnn aligner: Remove debug code
Convert: FFMpeg plugin - retry muxing audio on failure and properly error handle 
lib/gui/utils.py