16 lines
358 B
Python
16 lines
358 B
Python
#!/bin/python3
|
|
import subprocess
|
|
import glob
|
|
|
|
"""
|
|
check recursively every directory
|
|
for each image, create resize
|
|
|
|
"""
|
|
for f in glob.iglob('../static/files/images/**/*.jpg', recursive=True):
|
|
parent_dir = '/'.join(f.split('/')[:-1])
|
|
print(parent_dir)
|
|
subprocess.call(['convert', f, '-resize', '350x', parent_dir + '/' + 'thumb-250.jpg'])
|
|
|
|
|
|
|