Make scripts generic and fix several bugs

- Add optional directory argument to images_resize_recursive.sh,
  zip_images_resize_recursive.sh, and new rar2zip_recursive.sh
- Remove hardcoded-path wrappers rar2zip_images.sh and rar2zip_incomplete.sh
- Fix zip_images_resize.sh: move SCRIPT_DIR to top, change exit 1 to
  continue on bad output file so remaining files still process
- Use MAX_PIXELS variable in images_resize.sh resize argument
- Fix zip_images_recursive.sh: replace case-sensitive 7z globs with
  find -iregex piped via xargs
This commit is contained in:
2026-05-01 21:58:31 -04:00
parent 651cccc21c
commit fff8e346ad
8 changed files with 53 additions and 16 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ do
# Get file size before resizing
SIZE_BEFORE=$(stat -f%z "$f" 2>/dev/null || stat -c%s "$f" 2>/dev/null)
~/Applications/magick "$f" -resize 8000000@@\> -sampling-factor 4:2:0 -strip -quality 85% "$f"
~/Applications/magick "$f" -resize "${MAX_PIXELS}@@\>" -sampling-factor 4:2:0 -strip -quality 85% "$f"
# Get file size after resizing
SIZE_AFTER=$(stat -f%z "$f" 2>/dev/null || stat -c%s "$f" 2>/dev/null)