Skip to content

Instantly share code, notes, and snippets.

@lanceli
Created February 16, 2013 09:15

Revisions

  1. lanceli created this gist Feb 16, 2013.
    12 changes: 12 additions & 0 deletions downscale.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/bin/bash

    if [ $1 ]
    then
    echo Processing file $1;
    else
    for var in `find *.png`;
    do
    echo Processing file $var;
    sips -Z $(($(sips -g pixelWidth "$var" | cut -s -d ':' -f 2 | cut -c 2-) / 2)) "$var" --out "resized_$var" &> /dev/null
    done
    fi