From 770326900c33d463db554437502b7f492850403a Mon Sep 17 00:00:00 2001 From: kx1t Date: Thu, 16 Jan 2025 11:38:27 -0500 Subject: [PATCH] delete bad images instead of just skipping them --- rootfs/scripts/post2bsky.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rootfs/scripts/post2bsky.sh b/rootfs/scripts/post2bsky.sh index 7c20ad5..6f8980f 100755 --- a/rootfs/scripts/post2bsky.sh +++ b/rootfs/scripts/post2bsky.sh @@ -134,11 +134,13 @@ for image in "${IMAGES[@]}"; do if (( imgsize_org < 10000 )); then "${s6wrap[@]}" echo "Image size for $image is less than 10 KB ($imgsize_org). Is it really an image? Skipping..." + rm -f "$image" continue fi # shellcheck disable=SC2076 if [[ ! " jpeg jpg gif png " =~ " ${mimetype_local##*/} " ]]; then "${s6wrap[@]}" echo "Omitting image $image as it is not jpg, gif, or png. (Reported mimetype is ${mimetype_local##*/})" + rm -f "$image" continue fi if (( imgsize_org >= 950000 )); then