Skip to content

Commit 11824ff

Browse files
committed
Add 0005 file
1 parent 25a04ac commit 11824ff

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

Drake-Z/0005/0005.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@
66
__author__ = 'Drake-Z'
77

88
import os
9+
import glob
910
from PIL import Image
1011

1112
def thumbnail_pic(path):
12-
a = os.listdir(path)
13+
a = glob.glob(r'*.jpg')
1314
for x in a:
14-
name = os.path.join('0005', x)
15+
name = os.path.join(path, x)
1516
im = Image.open(name)
1617
im.thumbnail((1136, 640))
1718
print(im.format, im.size, im.mode)
1819
im.save(name, 'JPEG')
1920
print('Done!')
2021

2122
if __name__ == '__main__':
22-
path = '0005'
23+
path = '.'
2324
thumbnail_pic(path)

Drake-Z/0005/ace-94.jpg

109 KB
Loading

0 commit comments

Comments
 (0)