From 768db5a057c41961f4ff33ff1b185ef93d64f3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Sol=C3=ADs?= Date: Mon, 3 Feb 2025 17:37:29 +0000 Subject: [PATCH 1/3] fix: Roll back an overtuned limit --- friendica-clean-database.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/friendica-clean-database.sh b/friendica-clean-database.sh index 03163c8..d19954e 100755 --- a/friendica-clean-database.sh +++ b/friendica-clean-database.sh @@ -1,6 +1,6 @@ #!/bin/bash interval=7 -limit=100000 +limit=1000 echo "tmp_post_origin_deleted" tmp_post_origin_deleted_q="${limit}" From 41a3b86cab73c8854fc29467706260e515139a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Sol=C3=ADs?= Date: Mon, 3 Feb 2025 17:37:55 +0000 Subject: [PATCH 2/3] fix: Tune large GIF detection algorithms --- media-optimize-local.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/media-optimize-local.sh b/media-optimize-local.sh index b745d98..fd429ce 100755 --- a/media-optimize-local.sh +++ b/media-optimize-local.sh @@ -24,13 +24,13 @@ find . -type f -iname "*.gif" -size +500k | ( done; wait ) -#Specific compression for large GIF files -find . -type f -iname "*.gif" -size +512000 | ( +#Specific compression for large GIF files: halving the frame rate +find . -type f -size +500k -iname "*-320.gif" -or -iname "*-80.gif" -or -iname "*-48.gif" | ( while read p do while [[ $(stat -c%s "${p}" || 0) -ge 512000 ]] do - frameamount=$(exiftool -b -FrameCount "${p}") + frameamount=$(( $(exiftool -b -FrameCount "${p}" || 1) - 1 )) nice -n 15 gifsicle "${p}" $(seq -f "#%g" 0 2 "${frameamount}") -O3 --lossy=80 --colors=255 -o "${p}" done done From 48c38ea62d00ae6b98fa04f606275edfb9f13341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Sol=C3=ADs?= Date: Mon, 3 Feb 2025 17:38:13 +0000 Subject: [PATCH 3/3] fix: Tighten invalid file detection --- friendica-remove-invalid-photos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/friendica-remove-invalid-photos.sh b/friendica-remove-invalid-photos.sh index d64fe99..0376ffc 100755 --- a/friendica-remove-invalid-photos.sh +++ b/friendica-remove-invalid-photos.sh @@ -51,7 +51,7 @@ do echo "$id $avatar" sudo -u $user curl "$avatar" -s -o "$k_photo" #If the file is a valid picture (not empty, not text) - if file "$k_photo" | grep -q -v -e "text" -e "Empty" + if file "$k_photo" | grep -q -v -e "text" -e "empty" -e "symbolic link" -e "directory" then #Also fetch for thumb/micro and resize #As the photo is the largest version we have, we will use it as the base, and leave it last to convert