Commit ce17f8b0 authored by sajolida's avatar sajolida
Browse files

Merge remote-tracking branch 'origin/doc/10303-qrcode-scripts' (Closes: #10303)

parents b8629cc1 5e3339fa
......@@ -48,6 +48,28 @@ We recommend you to [[build an offline version of the
documentation|contribute/build/website]] to test your contributions
before sharing them with us.
# Tools
- Images on our website are compressed and cleaned using the
[[compress-image.sh]] script. To run this script you need the
`optipng`, `advancecomp`, and `mat` packages.
- To encode and decode QR codes, you can use the [[qrcode-encode.sh]]
and [[qrcode-decode.sh]] scripts. To run these scripts
you need to install the `qrencode` and `zbar-tools` packages.
For example:
qrcode-encode https://tails.boum.org/
Creates a QR code in tails_boum_org.png. And:
qrcode-decode tails_boum_org.png
Outputs:
QR-Code:https://tails.boum.org/
# Translating
We want Tails [[end-user documentation|doc]] to be translated in
......
#!/bin/bash
# To run this script in Debian, install the packages 'optipng' and 'advancecomp'.
set -e
set -u
for image in $* ; do
optipng -o6 $image
advdef -z3 $image
if [ ! -x /usr/bin/optipng ]; then
echo "Please install the \"optipng\" package." >&2
exit 1
fi
if [ ! -x /usr/bin/advdef ]; then
echo "Please install the \"advancecomp\" package." >&2
exit 1
fi
if [ ! -x /usr/bin/mat ]; then
echo "Please install the \"mat\" package." >&2
exit 1
fi
for image in "${@}" ; do
optipng -o6 "${image}"
advdef -z3 "${image}"
mat "${image}"
done
#!/bin/bash
set -e
set -u
if [ ! -x /usr/bin/zbarimg ]; then
echo "Please install the \"zbar-tools\" package." >&2
exit 1
fi
for code in "${@}" ; do
echo "${code}"
zbarimg "${code}"
done
#!/bin/bash
set -e
set -u
if [ ! -x /usr/bin/qrencode ]; then
echo "Please install the \"qrencode\" package." >&2
exit 1
fi
for code in "${@}" ; do
file="$(echo "${code}" | sed -r "s#http(s)?://##;s#/\$##;s#[/\.]#_#g")"
qrencode -o "${file}.png" -s 5 "${code}"
"$(dirname "${0}")/compress-image.sh" "${file}.png"
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment