(edit_do_undo): cleanup of labeled statement usage.
[midnight-commander.git] / misc / ext.d / image.sh
blobe09f92f9e42b679d89e8b40a11989208f4c9cbdb
1 #!/bin/sh
3 # $1 - action
4 # $2 - type of file
6 action=$1
7 filetype=$2
9 do_view_action() {
10 filetype=$1
12 case "${filetype}" in
13 jpeg)
14 identify "${MC_EXT_FILENAME}"; test -x /usr/bin/exif && echo && exif "${MC_EXT_FILENAME}" 2>/dev/null
16 xpm)
17 sxpm "${MC_EXT_FILENAME}"
20 identify "${MC_EXT_FILENAME}"
22 esac
25 do_open_action() {
26 filetype=$1
28 case "${filetype}" in
29 xbm)
30 bitmap "${MC_EXT_FILENAME}"
32 xcf)
33 (gimp "${MC_EXT_FILENAME}" &)
36 if [ -n "$DISPLAY" ]; then
37 (gqview "${MC_EXT_FILENAME}" &)
38 else
39 zgv "${MC_EXT_FILENAME}"
42 esac
45 case "${action}" in
46 view)
47 do_view_action "${filetype}"
49 open)
50 xdg-open "${MC_EXT_FILENAME}" 2>/dev/null || \
51 do_open_action "${filetype}"
55 esac