summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorleo-arch <leonardoabramovich2@gmail.com>2023-10-26 11:56:40 -0300
committerleo-arch <leonardoabramovich2@gmail.com>2023-10-26 11:56:40 -0300
commit5431489ee61a55e3c0d11f91613ddc1e443c52da (patch)
tree298bd480942a7d9b617aa165ae331165ff9d4b87
parent28179b59fa8d266c4f21ecc8ef07e574b007915c (diff)
Explicitely handle gif previewsv1.15
-rw-r--r--misc/tools/imgprev/README.md2
-rwxr-xr-xmisc/tools/imgprev/clifmimg17
2 files changed, 14 insertions, 5 deletions
diff --git a/misc/tools/imgprev/README.md b/misc/tools/imgprev/README.md
index 6f0430e6..63583399 100644
--- a/misc/tools/imgprev/README.md
+++ b/misc/tools/imgprev/README.md
@@ -54,6 +54,7 @@ The first parameter (thumbnailing method) could be any of the following:
* image
* video
+* gif
* epub
* pdf
* djvu
@@ -80,6 +81,7 @@ X:^application/epub\+zip$=clifmimg epub;
X:^application/pdf$=clifmimg pdf;
X:^image/vnd.djvu=clifmimg djvu;
X:^image/svg\+xml$=clifmimg svg;
+X:^image/gif$=clifmimg gif;
X:^image/.*=clifmimg image;
X:^video/.*=clifmimg video;
X:^audio/.*=clifmimg audio;
diff --git a/misc/tools/imgprev/clifmimg b/misc/tools/imgprev/clifmimg
index 619ed32e..79d29f88 100755
--- a/misc/tools/imgprev/clifmimg
+++ b/misc/tools/imgprev/clifmimg
@@ -33,6 +33,7 @@
#X:.*/pdf$=clifmimg pdf
#X:^image/vnd.djvu=clifmimg djvu
#X:^image/svg\+xml$=clifmimg svg;
+#X:^image/gif$=clifmimg gif;
#X:^image/.*=clifmimg image;
#X:^video/.*=clifmimg video;
#X:^audio/.*=clifmimg audio;
@@ -57,13 +58,13 @@
# The following applications are used to generate thumbnails:
# ffmpegthumbnailer (Video files)
# epub-thumbnailer (ePub files)
-# pdftoppm (PDF files, provided by the poppler package)
-# ddjvu (DjVu files, provided by the djvulibre package)
+# pdftoppm (PDF files - provided by the poppler package)
+# ddjvu (DjVu files - provided by the djvulibre package)
# ffmpeg (Audio files)
# fontpreview (Font files)
# libreoffice (Office files: odt, docx, xlsx, etc)
-# gs (Postscript files, provided by the ghostscript package)
-# convert (SVG files and sixel images, provided by the imagemagick package)
+# gs (Postscript files - provided by the ghostscript package)
+# convert (GIF, SVG files, and sixel images - provided by the imagemagick package)
#
# Note: The exact package names provinding these programs vary depending
# on your OS/distribution, but ususally they have the same name as the program
@@ -85,7 +86,7 @@ hash_file() {
PCACHE="$CACHE_DIR/$(md5 -q "$1")"
else
printf "clifm: No hashing application found.\nEither md5sum or md5 \
-are required.\n" >&2
+is required.\n" >&2
exit 1
fi
}
@@ -151,6 +152,12 @@ display() {
main() {
case "$type" in
"image") display "$file" ;;
+ "gif")
+ hash_file "$file"
+ ! [ -f "${PCACHE}.jpg" ] && \
+ convert -coalesce -resize 640x480\> "$file"[0] "${PCACHE}.jpg"
+ display "${PCACHE}.jpg"
+ ;;
"video")
hash_file "$file"
! [ -f "${PCACHE}.jpg" ] && \