view ss2thumb.sh @ 54:66bf613fb818

pre clean up push - moved vars into scoreB.js - called up with requirejs added requirejs dep
author tzara <rc-web@kiben.net>
date Wed, 19 Dec 2012 13:36:19 +0000
parents 7f0485e0d0ff
children 474c1ad1e811
line wrap: on
line source
#!/bin/bash

# calls phantomjs to make screenshots 
# of each anchor in PROJECT then calls
# imagemagick to resize them for preview
# panel. The size of the screenshot 
# is defined in rasterize.js

# nodescore@kiben.net
# nodescore.kiben.net

SERVER=$2
BASEDIR='m'
PROJECT=$1
THUMBPATH="www/$BASEDIR/thumbs"

if [ ! -d $THUMBPATH ];
    echo creating $THUMBPATH
    then mkdir -p $THUMBPATH;
fi

ANCHORS=`grep '<a' www/$BASEDIR/music.html|wc -l`
GAP=330
TOP=0
for each in $(seq 1 $ANCHORS);
do
    echo $TOP
    TOP=$(($TOP+$GAP));
    echo phantomjs rasterize.js $SERVER/$BASEDIR/music.html#$each $each.png $TOP

    phantomjs rasterize.js $SERVER/$BASEDIR/music.html#$each $each.png $TOP
    #mogrify -resize 400x  $each.png
    mv $each.png www/$BASEDIR/thumbs/

done