1
Fork 0
mirror of https://github.com/Steffo99/config-fish.git synced 2024-10-16 06:17:34 +00:00

Add pad-image function

This commit is contained in:
Steffo 2024-09-09 15:53:02 +02:00
parent 526504fe0c
commit 1be4fe9a77
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

10
functions/pad-image.fish Normal file
View file

@ -0,0 +1,10 @@
which magick --skip-functions >/dev/null 2>/dev/null
if [ $status -eq 0 ]
function pad-image
log-t "Creating" "Images padded to $argv[1]" "directory..."
command mkdir --parents "Images padded to $argv[1]"
log-d "Padding" "$argv[3]" "to $argv[1]..."
command magick -background "$argv[2]" "$argv[3]" -resize "$argv[1]" -gravity "center" -extent "$argv[1]" $argv[4..-1] "Images padded to $argv[1]/$argv[3]"
log-t "Done! Emoji added to the" "Images padded to $argv[1]" "directory!"
end
end