diff options
Diffstat (limited to 'content/notes')
| -rw-r--r-- | content/notes/bulk-make-thumbnails.md | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/content/notes/bulk-make-thumbnails.md b/content/notes/bulk-make-thumbnails.md index 8e4d54a..7a90391 100644 --- a/content/notes/bulk-make-thumbnails.md +++ b/content/notes/bulk-make-thumbnails.md | |||
| @@ -7,7 +7,7 @@ draft: false | |||
| 7 | tags: [bash] | 7 | tags: [bash] |
| 8 | --- | 8 | --- |
| 9 | 9 | ||
| 10 | Make bulk thumbnails with ImageMagick. | 10 | Make bulk thumbnails of JPGs with ImageMagick. |
| 11 | 11 | ||
| 12 | ```sh | 12 | ```sh |
| 13 | #!/bin/bash | 13 | #!/bin/bash |
| @@ -16,8 +16,6 @@ directory="./images/" | |||
| 16 | dimensions="360x360" | 16 | dimensions="360x360" |
| 17 | 17 | ||
| 18 | for file in "$directory"*.jpg; do | 18 | for file in "$directory"*.jpg; do |
| 19 | convert "$file" -resize $dimensions "$file" | 19 | convert "$file" -resize $dimensions "$file" "${file%.*}-thumbnail.jpg" |
| 20 | new_filename="${file%.*}-thumbnail.jpg" | ||
| 21 | mv "$file" "$new_filename" | ||
| 22 | done | 20 | done |
| 23 | ``` | 21 | ``` |
