Skip to content

Commit 68e0042

Browse files
committed
finish 0005
1 parent e1726b4 commit 68e0042

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Silocean/0005/Test.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*-coding:utf-8-*-
2+
__author__ = 'Tracy'
3+
import os
4+
import Image
5+
6+
path = 'images'
7+
8+
for f in os.listdir(path):
9+
img = Image.open(os.path.join(path, f))
10+
width = img.size[0]
11+
height = img.size[1]
12+
out = img
13+
if width > 1136:
14+
width = 1136
15+
out = img.resize((width, height), Image.ANTIALIAS)
16+
if height > 640:
17+
height = 640
18+
out = img.resize((width, height), Image.ANTIALIAS)
19+
out.save('images/result/'+f)

0 commit comments

Comments
 (0)