forked from Shinonome/dots-hyprland
wallpaper selector: progress indicator for thumbnail generation
This commit is contained in:
@@ -47,6 +47,12 @@ generate_thumbnail() {
|
||||
local src="$1"
|
||||
local abs_path
|
||||
abs_path="$(realpath "$src")"
|
||||
# Skip files with multiple frames (GIFs, videos, etc.)
|
||||
case "${abs_path,,}" in
|
||||
*.gif|*.mp4|*.webm|*.mkv|*.avi|*.mov)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
local encoded_path
|
||||
encoded_path="$(urlencode "$abs_path")"
|
||||
local uri
|
||||
@@ -58,7 +64,7 @@ generate_thumbnail() {
|
||||
if [ -f "$out" ]; then
|
||||
return
|
||||
fi
|
||||
magick "$abs_path" -resize ${THUMBNAIL_SIZE}x${THUMBNAIL_SIZE} "$out"
|
||||
magick "$abs_path" -resize "${THUMBNAIL_SIZE}x${THUMBNAIL_SIZE}" "$out"
|
||||
}
|
||||
|
||||
# Parse arguments
|
||||
|
||||
Reference in New Issue
Block a user