          self.configure(scrollregion=self.bbox("all"))
          self.update_idletasks()
  
          assert self._image is not None
  
          # Move to top left when resizing into screen dimensions (initial startup)
          if self.width > self._screen_dimensions[0]:
              logger.debug("Moving image to left edge")
 
</s> remove         self.config(width=self._image.width(), height=self._image.height())
 </s> add         if self._is_standalone:  # canvas size should not be updated inside GUI
            self.config(width=self._image.width(), height=self._image.height())
 </s> remove         """ Obtain the geometry of the current screen.
 </s> add         """ Obtain the geometry of the current screen (standalone) or the dimensions of the widget
        holding the preview window (GUI). </s> remove         Parameters
        ----------
        name: str
            The name of the training image to be resized
        frame_dims: tuple, optional
            The (width (`int`), height (`int`)) of the display panel that will display the preview.
            ``None`` if the frame dimensions are not known.
 </s> add         Should be called when terminating tasks, or when Faceswap starts up or shuts down. </s> remove         # TODO skip when loading in GUI?
        logger.debug("Obtaining screen geometry")
 </s> add         if not self._is_standalone:
            root = self._root.winfo_toplevel()  # Get dims of whole GUI
            retval = root.winfo_width(), root.winfo_height()
            logger.debug("Obtained frame geometry: %s", retval)
            return retval
 </s> remove         if self._scale != 1.0:
 </s> add         if self._scale not in (0.0, 1.0):  # Scale will be 0,0 on initial load in GUI
        self._center_image(self.width / 2, self.height / 2)
          self.configure(scrollregion=self.bbox("all"))
          self.update_idletasks()
  
          assert self._image is not None
        self._center_image(self.width / 2, self.height / 2)
  
          # Move to top left when resizing into screen dimensions (initial startup)
          if self.width > self._screen_dimensions[0]:
              logger.debug("Moving image to left edge")
keep keep keep add keep keep keep keep
 GUI - Preview updates
  - Training preview. Embed preview pop-out window
  - Bugfix - convert/extract previews 
lib/training/preview_tk.py