Added Readme and fixed no magick installation

This commit is contained in:
Hannes
2026-02-18 20:55:38 +01:00
parent 13e05a3f93
commit fb9b8090b2
2 changed files with 37 additions and 1 deletions
+14 -1
View File
@@ -26,6 +26,11 @@ for img in "$WALLPAPER_DIR"/*.{jpg,jpeg,png}; do
# Get just the filename
fname=$(basename "$img")
name="${fname%.*}"
ext="${fname##*.}"
# no magick file:
temp_image_name="$THUMB_DIR/${name}_tmp.${ext}"
# Output path
thumb="$THUMB_DIR/$fname"
@@ -38,7 +43,15 @@ for img in "$WALLPAPER_DIR"/*.{jpg,jpeg,png}; do
num+=1
# Generate thumbnail using ImageMagick
magick "$img" -resize "${MAX_DIM}x${MAX_DIM}" "$thumb"
if [ -x "/usr/bin/magick" ] then
magick "$img" -resize "${MAX_DIM}x${MAX_DIM}" "$thumb"
rm $temp_image_name
else
if [ -f "$temp_image_name" ] && [ "$temp_image_name" -nt "$img" ]; then
continue
fi
cp $img $temp_image_name
fi
done
echo "$num Thumbnails generated in $THUMB_DIR"