Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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((
|
23 |
|
24 |
-
with tempfile.NamedTemporaryFile(suffix='.
|
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 |
|