From 4e5eb615606bef1619071ef89d4b34c20a7ac625 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Mon, 20 Mar 2023 09:48:56 +0800 Subject: Move image utilities into bin/ --- alias | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'alias') diff --git a/alias b/alias index 6931902..2481990 100644 --- a/alias +++ b/alias @@ -413,41 +413,6 @@ alias xii='`fc -ln -1` | head -1 | xsel -ib' alias xo='xsel -ob' alias xl='history | tail -1 | grep -oP "^\s*[0-9]+\s\s\K.*" | xsel -ib && echo Copied to clipboard && xsel -ob' -# image -image.vertical() { - suffix=${1##*.} - convert "$@" -append $(basename -s .$suffix $1)-$(basename -s .$suffix ${@: -1}).${format:-$suffix} -} -image.horizontal() { - ext=${1##*.} - convert "$@" +append output.$ext -} -image.from_data_url() { - [[ $1 == '' ]] && echo File name needed && return 1 - xsel -ob | sed -E 's/^.+,//' | base64 -d >$1 - identify $1 -} -image.upload() { - local month=$(date +%Y-%m) - local filename=${2:-$(date +"%d_%Hh%Mm%Ss").${1##*.}} - local fpath='$HOME/data/s3.photos/'$month - cat $1 | ssh vps "mkdir -p $fpath && cat >$fpath/$filename" && \ - echo https://topo.tw/photos/$month/$filename || \ - echo Fail to upload -} -image.text() { - convert \ - -size 230x130 \ - -background lightblue \ - -font Noto-Sans-Bold \ - -pointsize 25 \ - -fill black \ - -gravity Center \ - caption:"${1:=foo}" \ - -flatten \ - "${2:=foo}".jpg -} - # Reset clock date-reset() { sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z" -- cgit v1.2.3-70-g09d2