mirror of
https://github.com/jarun/nnn.git
synced 2025-01-16 05:46:40 +00:00
Preview-tui fix gif conversion
This commit is contained in:
parent
a3d660b673
commit
beafeaaea2
|
@ -339,19 +339,22 @@ generate_preview() {
|
||||||
epub) gnome-epub-thumbnailer "$3" "$NNN_PREVIEWDIR/$3.jpg" ;;
|
epub) gnome-epub-thumbnailer "$3" "$NNN_PREVIEWDIR/$3.jpg" ;;
|
||||||
font) fontpreview -i "$3" -o "$NNN_PREVIEWDIR/$3.jpg" ;;
|
font) fontpreview -i "$3" -o "$NNN_PREVIEWDIR/$3.jpg" ;;
|
||||||
gif) if [ -p "$FIFO_UEBERZUG" ] && exists convert; then
|
gif) if [ -p "$FIFO_UEBERZUG" ] && exists convert; then
|
||||||
frameprefix="$NNN_PREVIEWDIR/$3/${3##*/}"
|
frameprefix="$NNN_PREVIEWDIR/$3/${3##*/}"
|
||||||
if [ ! -d "$NNN_PREVIEWDIR/$3" ]; then
|
if [ ! -d "$NNN_PREVIEWDIR/$3" ]; then
|
||||||
mkdir -p "$NNN_PREVIEWDIR/$3"
|
mkdir -p "$NNN_PREVIEWDIR/$3"
|
||||||
convert -coalesce -resize "$NNN_PREVIEWWIDTH"x"$NNN_PREVIEWHEIGHT"\> "$3" "$frameprefix.jpg"
|
convert -coalesce -resize "$NNN_PREVIEWWIDTH"x"$NNN_PREVIEWHEIGHT"\> "$3" "$frameprefix.jpg" ||
|
||||||
|
MAGICK_TMPDIR="/tmp" convert -coalesce -resize "$NNN_PREVIEWWIDTH"x"$NNN_PREVIEWHEIGHT"\> "$3" "$frameprefix.jpg"
|
||||||
fi
|
fi
|
||||||
while true; do
|
frames=$(($(find "$NNN_PREVIEWDIR/$3" | wc -l) - 2))
|
||||||
for i in $(seq 0 "$(($(find "$NNN_PREVIEWDIR/$3" | wc -l) - 2))"); do
|
[ $frames -lt 0 ] && return
|
||||||
image_preview "$1" "$2" "$frameprefix-$i.jpg"
|
while true; do
|
||||||
sleep 0.1
|
for i in $(seq 0 $frames); do
|
||||||
done
|
image_preview "$1" "$2" "$frameprefix-$i.jpg"
|
||||||
done &
|
sleep 0.1
|
||||||
printf "%s" "$!" > "$PREVIEWPID"
|
done
|
||||||
return
|
done &
|
||||||
|
printf "%s" "$!" > "$PREVIEWPID"
|
||||||
|
return
|
||||||
else
|
else
|
||||||
exec >/dev/tty
|
exec >/dev/tty
|
||||||
image_preview "$1" "$2" "$3"
|
image_preview "$1" "$2" "$3"
|
||||||
|
|
Loading…
Reference in a new issue