Added Readme and fixed no magick installation
This commit is contained in:
@@ -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"
|
||||
Reference in New Issue
Block a user