summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2021-08-13 02:43:35 -0700
committerxyz <gky44px1999@gmail.com>2021-08-13 02:43:35 -0700
commit3d75fadace421bf3768ae901a5825f86b04ce614 (patch)
treec92a1173986a80c32fd7e5bf9b0922bf2ba85868
parent937b047c2a08e99cfd2a329d94ed34a041b9744a (diff)
use -ping for identify, faster
-rwxr-xr-x.local/bin/convwall6
1 files changed, 4 insertions, 2 deletions
diff --git a/.local/bin/convwall b/.local/bin/convwall
index 7ef49a9f..286e85a8 100755
--- a/.local/bin/convwall
+++ b/.local/bin/convwall
@@ -6,8 +6,10 @@ hratio=$SCRHEIGHT
# chop how much from center
chopnum=99%
-width=$(identify -format '%w' "$1")
-height=$(identify -format '%h' "$1")
+# my benchmark shows -ping is much faster than default
+# https://github.com/ImageMagick/ImageMagick/issues/3183#issuecomment-800955241
+width=$(identify -ping -format '%w' "$1")
+height=$(identify -ping -format '%h' "$1")
ratio=$((wratio*100/hratio))
dim=$((width*100/height))