Skip to content

Instantly share code, notes, and snippets.

View johnnyg's full-sized avatar

John Garland johnnyg

  • Sydney, Australia
View GitHub Profile
@johnnyg
johnnyg / create-thumbnails
Created September 22, 2011 13:28 — forked from damoxc/create-thumbnails
Generate thumbnails and output media info
#!/bin/bash
parse_time() {
IFS=' ' read -ra PART <<< "$1"
seconds=0
for i in "${PART[@]}"; do
number=$(expr match $i '\([0-9]\+\)')
unit=$(expr match $i '[0-9]*\([a-z]\+\)')
case $unit in
h)