aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/imgresize
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-16 06:40:02 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-16 07:13:35 +0530
commitb8a973a91ac406266befcb36599ce8df64d096b9 (patch)
tree256fac02bace6a06cad239d37c19d1d400ee40e6 /plugins/imgresize
parenta2c2332fc549b43c91dce97f4c099bfa55762277 (diff)
downloadnnn-b8a973a91ac406266befcb36599ce8df64d096b9.tar.gz
Update plugins to support some env vars
Diffstat (limited to 'plugins/imgresize')
-rwxr-xr-xplugins/imgresize10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/imgresize b/plugins/imgresize
index def5560..d85d4b5 100755
--- a/plugins/imgresize
+++ b/plugins/imgresize
@@ -5,7 +5,7 @@
#
# Notes:
# 1. Set res if you don't want to be prompted for desktop resolution every time
-# 2. minsize is set to 1MB by default, adjust it if you want
+# 2. MINSIZE is set to 1MB by default, adjust it if you want
# 3. imgp options used:
# a - adaptive mode
# c - convert PNG to JPG
@@ -15,16 +15,16 @@
# Author: Arun Prakash Jana
# set resolution (e.g. 1920x1080)
-res=
+res="${RESOLUTION}"
# set minimum image size (in bytes) to resize (default: 1MB)
-minsize=1048576
+MINSIZE="${MINSIZE:-1048576}"
if [ -z "$res" ]; then
printf "desktop resolution (hxv): "
read -r res
fi
-if ! [ -z "$res" ] && ! [ -z "$minsize" ]; then
- imgp -ackx "$res" -s "$minsize"
+if ! [ -z "$res" ] && ! [ -z "$MINSIZE" ]; then
+ imgp -ackx "$res" -s "$MINSIZE"
fi