Skip already-processed ZIPs by sampling first JPEG comment
Extracts one JPEG from each ZIP to check for the processing comment before doing a full extract/resize/rezip cycle. Shared constants moved to config.sh as single source of truth. Trap and cleanup extended to cover the sample temp file.
This commit is contained in:
+3
-3
@@ -5,10 +5,10 @@
|
||||
#
|
||||
# Usage: xxx.sh
|
||||
|
||||
echo "Resizing large JPGs in $(pwd)"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/config.sh"
|
||||
|
||||
MAX_PIXELS=8000000
|
||||
MAGICK_COMMENT="magick:resize=8mp,quality=85,sampling=4:2:0"
|
||||
echo "Resizing large JPGs in $(pwd)"
|
||||
|
||||
find . -regextype posix-egrep -regex ".*\.(jpg|JPG|JPEG|jpeg)$" -print0 | while IFS= read -r -d '' f
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user