|
|
@ -157,14 +157,14 @@ get_image() { # <source> [ <command> ] |
|
|
|
*) cmd="cat";; |
|
|
|
*) cmd="cat";; |
|
|
|
esac |
|
|
|
esac |
|
|
|
if [ -z "$conc" ]; then |
|
|
|
if [ -z "$conc" ]; then |
|
|
|
local magic="$(eval $cmd $from | dd bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')" |
|
|
|
local magic="$(eval $cmd $from 2>/dev/null | dd bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')" |
|
|
|
case "$magic" in |
|
|
|
case "$magic" in |
|
|
|
1f8b) conc="zcat";; |
|
|
|
1f8b) conc="zcat";; |
|
|
|
425a) conc="bzcat";; |
|
|
|
425a) conc="bzcat";; |
|
|
|
esac |
|
|
|
esac |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
eval "$cmd $from ${conc:+| $conc}" |
|
|
|
eval "$cmd $from 2>/dev/null ${conc:+| $conc}" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
get_magic_word() { |
|
|
|
get_magic_word() { |
|
|
|