annotate tools/create-screenshot-for-doc @ 2988:aca8511e7751

qt.mk: link to correct files in bin directory
author John W. Eaton <jwe@octave.org>
date Thu, 16 May 2013 13:32:57 -0400
parents 14b3f5ea78ae
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2358
14b3f5ea78ae Cleanup coding style via "make cleanup-style"
Volker Grabsch <vog@notjusthosting.com>
parents: 2176
diff changeset
1 #!/usr/bin/env bash
2176
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
2 set -eu
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
3
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
4 if [ "$#" -ne 2 ]; then
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
5 echo
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
6 echo "Syntax: $0 [IMAGE.png] [NAME]"
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
7 echo
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
8 echo 'IMAGE.png -> screenshot-NAME.png + screenshot-NAME-small.png'
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
9 echo
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
10 exit 1
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
11 fi
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
12
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
13 set -v
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
14
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
15 IMAGE_FILE="$1"
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
16 NAME="$2"
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
17
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
18 cat "$IMAGE_FILE" \
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
19 | pngtopnm \
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
20 | pnmtopng -compression 9 \
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
21 > "screenshot-$NAME.png"
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
22
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
23 cat "screenshot-$NAME.png" \
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
24 | pngtopnm \
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
25 | pnmscale -ysize 128 \
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
26 > "screenshot-$NAME-small.pnm"
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
27
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
28 pnmquant 256 "screenshot-$NAME-small.pnm" \
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
29 | pnmtopng -compression 9 \
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
30 > "screenshot-$NAME-small.png"
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
31
4e68de2de908 Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
32 rm -f "screenshot-$NAME-small.pnm"