Thom Nichols

Thom

Technology is evolution outside the gene pool

Articles tagged with 'graphics'

Batch Photo Thumbnail Creation for FancyBox

A quick script I wrote to batch create photo thumbnails for use with FancyBox.  This means each thumbnail gets the same filename with '_m' appended before the extension.  It uses the ImageMagick command-line tool convert to perform the actual image processing.

#!/usr/bin/env python

import sys, os, subprocess


def convert(directory=None, size='300x300'):

 if not directory: directory = os.getcwd()
 print('Dir: %s' % directory)

 if not size ...