fix: Correct permissions and frame amount counter
This commit is contained in:
parent
f6503dbe78
commit
7456eb97a1
1 changed files with 4 additions and 3 deletions
|
@ -5,7 +5,7 @@ IFS="
|
||||||
site=friendica.example.net
|
site=friendica.example.net
|
||||||
user=friendica
|
user=friendica
|
||||||
group=www-data
|
group=www-data
|
||||||
fileperm=640
|
fileperm=660
|
||||||
folderperm=770
|
folderperm=770
|
||||||
folder=/var/www/friendica
|
folder=/var/www/friendica
|
||||||
folderescaped=${folder////\\/}
|
folderescaped=${folder////\\/}
|
||||||
|
@ -19,7 +19,7 @@ loop_1() {
|
||||||
nice -n 10 gifsicle --batch -O3 --lossy=80 --colors=255 "${p}" #&> /dev/null
|
nice -n 10 gifsicle --batch -O3 --lossy=80 --colors=255 "${p}" #&> /dev/null
|
||||||
#Specific compression for large GIF files
|
#Specific compression for large GIF files
|
||||||
while [[ $(stat -c%s "${p}" || 0) -ge 512000 ]]; do
|
while [[ $(stat -c%s "${p}" || 0) -ge 512000 ]]; do
|
||||||
frameamount=$(exiftool -b -FrameCount "${p}" || 1)
|
frameamount=$(($(exiftool -b -FrameCount "${p}" || 1) - 1))
|
||||||
nice -n 10 gifsicle "${p}" $(seq -f "#%g" 0 2 "${frameamount}") -O3 --lossy=80 --colors=255 -o "${p}" #&> /dev/null
|
nice -n 10 gifsicle "${p}" $(seq -f "#%g" 0 2 "${frameamount}") -O3 --lossy=80 --colors=255 -o "${p}" #&> /dev/null
|
||||||
done
|
done
|
||||||
elif [[ "${p}" =~ .png ]]; then
|
elif [[ "${p}" =~ .png ]]; then
|
||||||
|
@ -43,7 +43,8 @@ loop_1() {
|
||||||
|
|
||||||
cd "${folder}" || exit
|
cd "${folder}" || exit
|
||||||
if [[ ! -f "${tmpfile}" ]]; then
|
if [[ ! -f "${tmpfile}" ]]; then
|
||||||
sudo -u "${user}" bin/console movetoavatarcache | sudo tee "${tmpfile}" #&> /dev/null
|
#sudo -u "${user}" bin/console movetoavatarcache | sudo tee "${tmpfile}" #&> /dev/null
|
||||||
|
sudo bin/console movetoavatarcache | sudo tee "${tmpfile}" #&> /dev/null
|
||||||
fi
|
fi
|
||||||
grep -e "https://${site}/${avatarfolder}/" "${tmpfile}" | sed -e "s/.*${site}/${folderescaped}/g" -e "s/?ts=.*//g" | (
|
grep -e "https://${site}/${avatarfolder}/" "${tmpfile}" | sed -e "s/.*${site}/${folderescaped}/g" -e "s/?ts=.*//g" | (
|
||||||
while read -r i; do
|
while read -r i; do
|
||||||
|
|
Loading…
Add table
Reference in a new issue