My final solution … not the best way to do this, not even close to EWWW, but it worked for me, Google page speed doesn’t complain abut the pictures anymore … I OPTIPNG all the files while making the backups ( -preserve parameter ) than restored the ownership to local user
Same thing with JPEGOPTIM for jpg files, but i did it with lossy compression of 90 ( parameter -p90 ) cause some files where huge
And at the very last line it restores ownership on public_html folder … without this i would get error 403 on the website
all this just for one account (cormsorg) …
And i didnt find safe solution for .gif files yet…
cd /home/cormsorg/public_html
find -name ‘*.png’ -print0 | xargs -0 optipng -o7 -keep -preserve -log optipng.log
find -name ‘*.png’ -print0 | xargs -0 chown cormsorg:cormsorg -v
find -name ‘*.jpg’ -print0 | xargs -0 jpegoptim -p -P -m90 –all-progressive -t -v -s
find -name ‘*.jpg’ -print0 | xargs -0 chown cormsorg:cormsorg -v
find -name ‘*.jpeg’ -print0 | xargs -0 jpegoptim -p -P -m90 –all-progressive -t -v -s
find -name ‘*.jpeg’ -print0 | xargs -0 chown cormsorg:cormsorg -v
chown cormsorg:nobody /home/cormsorg/public_html -v