mirror of
https://github.com/dnet/pySSTV.git
synced 2026-04-05 06:15:19 +00:00
enlarge images narrower than 200px
This commit is contained in:
parent
d50797b69c
commit
28098de403
1 changed files with 4 additions and 0 deletions
|
|
@ -72,6 +72,10 @@ class ProgressCanvas(Canvas):
|
||||||
width, height = image.size
|
width, height = image.size
|
||||||
if height / float(width) > 1.5:
|
if height / float(width) > 1.5:
|
||||||
width *= 2
|
width *= 2
|
||||||
|
elif width < 200:
|
||||||
|
width *= 2
|
||||||
|
height *= 2
|
||||||
|
if (width, height) != image.size:
|
||||||
image = image.resize((width, height))
|
image = image.resize((width, height))
|
||||||
Canvas.__init__(self, master, width=width, height=height)
|
Canvas.__init__(self, master, width=width, height=height)
|
||||||
self.tk_img = ImageTk.PhotoImage(image)
|
self.tk_img = ImageTk.PhotoImage(image)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue