use thumbnails instead of full size pics
This commit is contained in:
15
thumbnailer.py
Executable file
15
thumbnailer.py
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
from PIL import Image
|
||||
import glob, os
|
||||
|
||||
size = 128, 128
|
||||
|
||||
work_path = os.getcwd()
|
||||
|
||||
for infile in glob.glob(work_path + "/fullsize/*.png"):
|
||||
file, ext = os.path.splitext(infile)
|
||||
with Image.open(infile) as im:
|
||||
im.thumbnail(size)
|
||||
filename = file.split('/')[-1:][0]
|
||||
im.save(work_path + "/thumbnails/" + filename + ".jpg", "JPEG")
|
||||
Reference in New Issue
Block a user