Weaita commited on
Commit
e690df3
·
1 Parent(s): d5928ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -19,12 +19,14 @@ def split_image(image):
19
  box = (j*width/3, i*height/3, (j+1)*width/3, (i+1)*height/3)
20
  region = im.crop(box)
21
  region = region.convert("RGB")
22
- region = region.resize((512, 512), Image.ANTIALIAS)
23
 
24
- with tempfile.NamedTemporaryFile(suffix='.jpg') as temp:
25
  region.save(temp.name)
26
  images.append(temp.name)
27
  zip.write(temp.name)
 
 
28
 
29
  return "images.zip"
30
 
 
19
  box = (j*width/3, i*height/3, (j+1)*width/3, (i+1)*height/3)
20
  region = im.crop(box)
21
  region = region.convert("RGB")
22
+ region = region.resize((width/3, height/3), Image.ANTIALIAS)
23
 
24
+ with tempfile.NamedTemporaryFile(suffix='.png') as temp:
25
  region.save(temp.name)
26
  images.append(temp.name)
27
  zip.write(temp.name)
28
+ temp.flush()
29
+ temp.close()
30
 
31
  return "images.zip"
32