bin/b: adapt image display to number of args

This commit is contained in:
xeruf 2021-12-12 11:51:24 +01:00
parent 10536a6b1b
commit 5c32cd94fc
1 changed files with 9 additions and 8 deletions

View File

@ -97,15 +97,16 @@ done
if test "$timg"; then
$elevate timg -V --rotate=exif -g $(tput cols)x$(expr $(tput lines) / 2) \
$(test $# -gt 1 && echo "-t0.2 --center --title --grid=$(expr $(tput cols) / 20)x2") \
$(test $# -gt 1 && echo "-t0.2 --center --title --grid=$(expr $(tput cols) / \( 30 - $# \& $# \< 20 \| 10 \))x2") \
"${timg[@]}" "${timga[@]}" 2>/dev/null
tput setaf 6
for img in "${timg[@]}"
do ident="$(identify -ping -precision 3 -format "%wx%h %b %m %[bit-depth]-bit %[colorspace]" "$img")"
printf "%11s %-30s %s\n" "${ident%% *}" "$(basename "$img")" "${ident#* }"
done
tput sgr0
if test $# -lt 15; then
tput setaf 6
for img in "${timg[@]}"
do ident="$(identify -ping -precision 3 -format "%wx%h %b %m %[bit-depth]-bit %[colorspace]" "$img")"
printf "%11s %-30s %s\n" "${ident%% *}" "$(basename "$img")" "${ident#* }"
done
tput sgr0
fi
fi
if test "$bat"; then