annotate tools/create-screenshot-for-doc @ 4545:0e56fe2d2ef5

Makefile.in: add update-build-tools target * Makefile.in: add update-build-tools target * src/build-autoconf.mk, src/build-automake.mk, src/build-bison.mk, src/build-gawk.mk, src/build-gcc.mk, src/build-gettext.mk, src/build-gperf.mk, src/build-m4.mk, src/build-texinfo.mk, src/build-libtool.mk : update PKG_UPDATE for getting latest version from gnu.org * src/build-cmake.mk, src/build-flex.mk, src/build-lzip.mk, src/build-pkg-config.mk, src/pkg-config.mk, src/build-scons.mk : add implemented PKG_UPDATE macro
author John Donoghue <john.donoghue@ieee.org>
date Thu, 23 Nov 2017 12:05:29 -0500
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"