Compare commits
2 commits
08c4097734
...
03c693c20a
Author | SHA1 | Date | |
---|---|---|---|
03c693c20a | |||
929936f67f |
2 changed files with 37 additions and 0 deletions
|
@ -1,2 +1,6 @@
|
|||
# borsize.sh
|
||||
|
||||
Script that automates the addition of borders and then resizes the desired image(s).
|
||||
|
||||
Requirements :
|
||||
- Imagemagick
|
33
borsize.sh
Executable file
33
borsize.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
## author : KazukyAkayashi
|
||||
## description : Script that automates the addition of borders and then resizes the desired image(s).
|
||||
|
||||
## Bash strict mode ####################################
|
||||
set -o errexit # abort on nonzero exitstatus
|
||||
set -o nounset # abort on unbound variable
|
||||
set -o pipefail # don't hide errors within pipes
|
||||
|
||||
## Script ##############################################
|
||||
|
||||
## You need Imagemagick
|
||||
readonly SCRIPTNAME="$(basename "$0")"
|
||||
echo "Start ${SCRIPTNAME}"
|
||||
|
||||
## Enter the desired name for the folder : web, pixelfed ...
|
||||
FILE=web
|
||||
if [ ! -d "$FILE" ];
|
||||
then
|
||||
echo "Create ${FILE} directory"
|
||||
mkdir web
|
||||
fi
|
||||
|
||||
## Change border or/and resize if you want.
|
||||
## Add -quality 95 if you need reduce file weight.
|
||||
## If you use a format other than JPG, don't forget to change it.
|
||||
echo "Start Imagemagick"
|
||||
magick mogrify *.jpg -bordercolor White -border 145x145 -resize 1080x -path ${FILE} *.jpg
|
||||
|
||||
echo "exiting ${SCRIPTNAME}"
|
||||
exit 0
|
||||
|
||||
## END Script #####################################
|
Loading…
Reference in a new issue