@@ -0,0 +1,945 @@
+#!/usr/bin/env python%0A%0A# https://makerhacks.com/thumbnail-images-using-python/%0A%0Aimport sys%0Aimport os%0Aimport glob%0Afrom PIL import Image%0Afrom pmagpy import pmag%0A%0Adef main(directory):%0A    # get all the jpg files from the current folder%0A    directory = os.path.realpath(directory)%0A    for infile in glob.glob(os.path.join(directory, %22*.png%22)):%0A        if infile.endswith('thumb.png'):%0A            continue%0A        im = Image.open(infile)%0A    # convert to thumbnail image%0A        im.thumbnail((128, 128), Image.ANTIALIAS)%0A    # prefix thumbnail file with T_%0A        im.save(infile%5B:-4%5D + %22.thumb.png%22, %22PNG%22)%0A%0A%0Aif __name__ == %22__main__%22:%0A    if %22-h%22 in sys.argv:%0A        print('Make thumbnails for every png in current directory, or use: thumbnails.py -WD %3Cdirectory%3E')%0A        print('Output files will follow the naming convention: %22original_filename.thumb.png%22')%0A    else:%0A        directory = pmag.get_named_arg(%22-WD%22, %22.%22)%0A        main(directory)%0A

add thumbnails.py program, #518