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:
@@ -10,6 +10,8 @@ if [ $# -eq 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
echo "Resizing large JPGs in ZIPs"
|
||||
|
||||
# Use RAM disk for temporary files.
|
||||
@@ -64,7 +66,6 @@ for INFILE in "$@"; do
|
||||
cleanup_temp
|
||||
continue
|
||||
fi
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
"$SCRIPT_DIR/images_resize.sh"
|
||||
popd > /dev/null
|
||||
|
||||
@@ -88,7 +89,7 @@ for INFILE in "$@"; do
|
||||
if [ ! -s "$OUTFILE" ]; then
|
||||
echo "Error: Output file is empty or does not exist. Keeping original file."
|
||||
cleanup_temp
|
||||
exit 1
|
||||
continue
|
||||
fi
|
||||
|
||||
rm "$INFILE"
|
||||
|
||||
Reference in New Issue
Block a user