Compare commits
3 commits
363189597c
...
48c38ea62d
Author | SHA1 | Date | |
---|---|---|---|
48c38ea62d | |||
41a3b86cab | |||
768db5a057 |
3 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
interval=7
|
interval=7
|
||||||
limit=100000
|
limit=1000
|
||||||
|
|
||||||
echo "tmp_post_origin_deleted"
|
echo "tmp_post_origin_deleted"
|
||||||
tmp_post_origin_deleted_q="${limit}"
|
tmp_post_origin_deleted_q="${limit}"
|
||||||
|
|
|
@ -51,7 +51,7 @@ do
|
||||||
echo "$id $avatar"
|
echo "$id $avatar"
|
||||||
sudo -u $user curl "$avatar" -s -o "$k_photo"
|
sudo -u $user curl "$avatar" -s -o "$k_photo"
|
||||||
#If the file is a valid picture (not empty, not text)
|
#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
|
then
|
||||||
#Also fetch for thumb/micro and resize
|
#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
|
#As the photo is the largest version we have, we will use it as the base, and leave it last to convert
|
||||||
|
|
|
@ -24,13 +24,13 @@ find . -type f -iname "*.gif" -size +500k | (
|
||||||
done;
|
done;
|
||||||
wait
|
wait
|
||||||
)
|
)
|
||||||
#Specific compression for large GIF files
|
#Specific compression for large GIF files: halving the frame rate
|
||||||
find . -type f -iname "*.gif" -size +512000 | (
|
find . -type f -size +500k -iname "*-320.gif" -or -iname "*-80.gif" -or -iname "*-48.gif" | (
|
||||||
while read p
|
while read p
|
||||||
do
|
do
|
||||||
while [[ $(stat -c%s "${p}" || 0) -ge 512000 ]]
|
while [[ $(stat -c%s "${p}" || 0) -ge 512000 ]]
|
||||||
do
|
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}"
|
nice -n 15 gifsicle "${p}" $(seq -f "#%g" 0 2 "${frameamount}") -O3 --lossy=80 --colors=255 -o "${p}"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue