Python Tkinter: AttributeError: 'PhotoImage' object has no ...
stackoverflow.com › questions › 64522972Oct 25, 2020 · The problem is that my image = Image.open(...) was being garbage collected, so I had to add self. so it is not destroyed. See code snippet below: def resize_image(self, img_path): self.image = Image.open(img_path) w_coeff = self.image.width / self.grid_w h_coeff = self.image.height / self.grid_h w_coeff = 1 / w_coeff if w_coeff > 1 else w_coeff h_coeff = 1 / h_coeff if h_coeff > 1 else h_coeff ...