Omnibus commited on
Commit
b1ea448
·
1 Parent(s): e955094

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -29,6 +29,14 @@ def update_game(sky=None,platform=None,star=None,bomb=None,dude=None):
29
  def dif_fn(inp):
30
  output=diff.send_it(inp,5,1)
31
  outp=Image.open(output[0])
 
 
 
 
 
 
 
 
32
  outp.save("tmp_sky.png")
33
  out = os.path.abspath("tmp_sky.png")
34
  out_url = f'https://omnibus-game-test.hf.space/file={out}'
 
29
  def dif_fn(inp):
30
  output=diff.send_it(inp,5,1)
31
  outp=Image.open(output[0])
32
+ width, height = outp.size
33
+ rat = width/height
34
+ if width > height:
35
+ outp = outp.resize(600*rat,600)
36
+ elif width < height:
37
+ outp = outp.resize(800,800*rat)
38
+ else:
39
+ outp = outp.resize(800,800)
40
  outp.save("tmp_sky.png")
41
  out = os.path.abspath("tmp_sky.png")
42
  out_url = f'https://omnibus-game-test.hf.space/file={out}'