# HG changeset patch # User Volker Grabsch # Date 1324026327 -3600 # Node ID 4e68de2de90854eda5d1254afe58ef7c340f9431 # Parent 2bbf834b331de58390708c581917cf01ef84652d Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/ diff -r 2bbf834b331d -r 4e68de2de908 tools/create-screenshot-for-doc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/create-screenshot-for-doc Fri Dec 16 10:05:27 2011 +0100 @@ -0,0 +1,32 @@ +#!/bin/bash +set -eu + +if [ "$#" -ne 2 ]; then + echo + echo "Syntax: $0 [IMAGE.png] [NAME]" + echo + echo 'IMAGE.png -> screenshot-NAME.png + screenshot-NAME-small.png' + echo + exit 1 +fi + +set -v + +IMAGE_FILE="$1" +NAME="$2" + +cat "$IMAGE_FILE" \ +| pngtopnm \ +| pnmtopng -compression 9 \ +> "screenshot-$NAME.png" + +cat "screenshot-$NAME.png" \ +| pngtopnm \ +| pnmscale -ysize 128 \ +> "screenshot-$NAME-small.pnm" + +pnmquant 256 "screenshot-$NAME-small.pnm" \ +| pnmtopng -compression 9 \ +> "screenshot-$NAME-small.png" + +rm -f "screenshot-$NAME-small.pnm"