We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25a04ac commit 11824ffCopy full SHA for 11824ff
2 files changed
Drake-Z/0005/0005.py
@@ -6,18 +6,19 @@
6
__author__ = 'Drake-Z'
7
8
import os
9
+import glob
10
from PIL import Image
11
12
def thumbnail_pic(path):
- a = os.listdir(path)
13
+ a = glob.glob(r'*.jpg')
14
for x in a:
- name = os.path.join('0005', x)
15
+ name = os.path.join(path, x)
16
im = Image.open(name)
17
im.thumbnail((1136, 640))
18
print(im.format, im.size, im.mode)
19
im.save(name, 'JPEG')
20
print('Done!')
21
22
if __name__ == '__main__':
- path = '0005'
23
+ path = '.'
24
thumbnail_pic(path)
Drake-Z/0005/ace-94.jpg
109 KB
0 commit comments