Preview-tui fix gif conversion

This commit is contained in:
Luuk van Baal 2021-12-20 02:39:10 +01:00 committed by Arun Prakash Jana
parent a3d660b673
commit beafeaaea2
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 13 additions and 10 deletions

View File

@ -342,10 +342,13 @@ generate_preview() {
frameprefix="$NNN_PREVIEWDIR/$3/${3##*/}"
if [ ! -d "$NNN_PREVIEWDIR/$3" ]; then
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
frames=$(($(find "$NNN_PREVIEWDIR/$3" | wc -l) - 2))
[ $frames -lt 0 ] && return
while true; do
for i in $(seq 0 "$(($(find "$NNN_PREVIEWDIR/$3" | wc -l) - 2))"); do
for i in $(seq 0 $frames); do
image_preview "$1" "$2" "$frameprefix-$i.jpg"
sleep 0.1
done