Skip to content

Commit

Permalink
delete bad images instead of just skipping them
Browse files Browse the repository at this point in the history
  • Loading branch information
kx1t committed Jan 16, 2025
1 parent e485b34 commit 7703269
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rootfs/scripts/post2bsky.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7703269

Please sign in to comment.