Created
January 9, 2020 23:38
-
-
Save sigwinch28/a63ad6d94fcd806aafa4d486c0be5fcf to your computer and use it in GitHub Desktop.
QR code with label
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Requirements: imagemagick (for `identify` and `convert`) and qrencode | |
TEXT="$1" | |
OUT_FILE="$2" | |
QR_IMG_FILE=$(mktemp --suffix=.png) | |
qrencode -s 6 -o "$QR_IMG_FILE" "$TEXT" | |
WIDTH=$(identify -format '%w' "$QR_IMG_FILE") | |
convert "$QR_IMG_FILE" \( -size "${WIDTH}x" -gravity center label:"$TEXT" \) -append "$OUT_FILE" | |
rm "$QR_IMG_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment