Align shell style all over the repo
This commit is contained in:
parent
afb13d9c9c
commit
d5e71c46f7
16 changed files with 113 additions and 86 deletions
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# env
|
||||
# Written in 2019 by Lucas
|
||||
# Written in 2019-2020 by Lucas
|
||||
# CC0 1.0 Universal/Public domain - No rights reserved
|
||||
#
|
||||
# To the extent possible under law, the author(s) have dedicated all
|
||||
|
@ -16,19 +16,18 @@
|
|||
: ${IMAGE_HEIGHT:=500}
|
||||
: ${IMAGE_WIDTH:=500}
|
||||
|
||||
pos_x=$((3 * $CANVAS_WIDTH / 4 - $IMAGE_WIDTH / 2))
|
||||
pos_y=$(($CANVAS_HEIGHT / 2 - $IMAGE_HEIGHT / 2))
|
||||
pos_x=$((3 * CANVAS_WIDTH / 4 - IMAGE_WIDTH / 2))
|
||||
pos_y=$((CANVAS_HEIGHT / 2 - IMAGE_HEIGHT / 2))
|
||||
|
||||
if ! tmpfile=$(mktemp -t bg.XXXXXXXXXX); then
|
||||
printf "%s: Can't create temporary file.\n" "${0##*/}" >&2
|
||||
printf "%s: can't create temporary file\n" "${0##*/}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap 'rm -f "$tmpfile"' EXIT INT QUIT TERM
|
||||
|
||||
pngtopam -alphapam FreeHugsBSD.png \
|
||||
| pamscale -width="$IMAGE_WIDTH" -height="$IMAGE_HEIGHT" \
|
||||
>"$tmpfile"
|
||||
ppmmake "$CANVAS_BGCOLOR" "$CANVAS_WIDTH" "$CANVAS_HEIGHT" \
|
||||
| pamcomp -xoff="$pos_x" -yoff="$pos_y" "$tmpfile" \
|
||||
| pamtopng >FreeHugsBSD-bg.png
|
||||
pngtopam -alphapam FreeHugsBSD.png |
|
||||
pamscale -width "$IMAGE_WIDTH" -height "$IMAGE_HEIGHT" >"$tmpfile"
|
||||
ppmmake "$CANVAS_BGCOLOR" "$CANVAS_WIDTH" "$CANVAS_HEIGHT" |
|
||||
pamcomp -xoff "$pos_x" -yoff "$pos_y" "$tmpfile" |
|
||||
pamtopng >FreeHugsBSD-bg.png
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# env
|
||||
# Written in 2019 by Lucas
|
||||
# Written in 2019-2020 by Lucas
|
||||
# CC0 1.0 Universal/Public domain - No rights reserved
|
||||
#
|
||||
# To the extent possible under law, the author(s) have dedicated all
|
||||
|
@ -16,19 +16,18 @@
|
|||
: ${IMAGE_HEIGHT:=768}
|
||||
: ${IMAGE_WIDTH:=1080}
|
||||
|
||||
pos_x=$((($CANVAS_WIDTH - $IMAGE_WIDTH) / 2))
|
||||
pos_y=$((($CANVAS_HEIGHT - $IMAGE_HEIGHT) / 2))
|
||||
pos_x=$(((CANVAS_WIDTH - IMAGE_WIDTH) / 2))
|
||||
pos_y=$(((CANVAS_HEIGHT - IMAGE_HEIGHT) / 2))
|
||||
|
||||
if ! tmpfile=$(mktemp -t bg.XXXXXXXXXX); then
|
||||
printf "%s: Can't create temporary file.\n" "${0##*/}" >&2
|
||||
printf "%s: can't create temporary file\n" "${0##*/}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap 'rm -f "$tmpfile"' EXIT INT QUIT TERM
|
||||
|
||||
pngtopam -alphapam cyberia-cafe-club.png \
|
||||
| pamscale -width="$IMAGE_WIDTH" -height="$IMAGE_HEIGHT" \
|
||||
>"$tmpfile"
|
||||
ppmmake "$CANVAS_BGCOLOR" "$CANVAS_WIDTH" "$CANVAS_HEIGHT" \
|
||||
| pamcomp -xoff="$pos_x" -yoff="$pos_y" "$tmpfile" \
|
||||
| pamtopng >cyberia-cafe-club-bg.png
|
||||
pngtopam -alphapam cyberia-cafe-club.png |
|
||||
pamscale -width "$IMAGE_WIDTH" -height "$IMAGE_HEIGHT" >"$tmpfile"
|
||||
ppmmake "$CANVAS_BGCOLOR" "$CANVAS_WIDTH" "$CANVAS_HEIGHT" |
|
||||
pamcomp -xoff "$pos_x" -yoff "$pos_y" "$tmpfile" |
|
||||
pamtopng >cyberia-cafe-club-bg.png
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue