23 lines
386 B
Plaintext
23 lines
386 B
Plaintext
|
#!/bin/sh -e
|
||
|
|
||
|
type=$(file --mime-type "${1}" | cut -f 2 -d ' ')
|
||
|
|
||
|
case "${type}" in
|
||
|
|
||
|
*image/png*)
|
||
|
x=$(/bin/file "${1}" | /bin/grep -o "[0-9]* x [0-9]*" | sed 's/ x /x/')
|
||
|
;;
|
||
|
|
||
|
*image/jpeg*)
|
||
|
x=$(/bin/file "${1}" | /bin/grep -o "[0-9]*x[0-9]*" | sed "2!d")
|
||
|
;;
|
||
|
|
||
|
*)
|
||
|
x=$(/bin/file "${1}" | /bin/grep -o "[0-9]* x [0-9]*" | sed 's/ x /x/')
|
||
|
;;
|
||
|
|
||
|
esac
|
||
|
|
||
|
/bin/sxiv -bg "${x}" "${1}"
|
||
|
exit
|