Skip to content

Commit

Permalink
fix(tk): add alternative PhotImage import using tkinter #23
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnec committed Sep 14, 2021
1 parent e4406fb commit 5291b72
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plenopticam/gui/widget_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@
except ImportError:
import Tkinter as tk

from PIL import Image, ImageTk, ImageFont, ImageDraw
from PIL import Image, ImageFont, ImageDraw
import os, sys
from functools import partial
import glob

try:
from PIL.ImageTk import PhotoImage
except:
PhotoImage = tk.PhotoImage

from plenopticam.lfp_extractor import LfpViewpoints
from plenopticam.misc.os_ops import get_img_list
from plenopticam import __version__
Expand Down Expand Up @@ -142,7 +147,7 @@ def show_image(self, arg=None):
next_frame = self.get_dummy

# set tk frame as member variable as it gets lost otherwise
self.tk_frame = ImageTk.PhotoImage(next_frame)
self.tk_frame = PhotoImage(next_frame)

self.delete(self.find_withtag("bacl"))
self.allready = self.create_image(PX*4, PY*4, image=self.tk_frame, anchor=tk.NW, tag="bacl")
Expand Down

0 comments on commit 5291b72

Please sign in to comment.