We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e1726b4 commit 68e0042Copy full SHA for 68e0042
1 file changed
Silocean/0005/Test.py
@@ -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
19
+ out.save('images/result/'+f)
0 commit comments