Steps to reproduce
- Run $NEXTCLOUD_DIR/core/img/image-optimization.sh
The Issue
Jpegoptim doesn't accept glob patterns (jpegoptim: skipping special file: *.jpg). It doesn't seem to handle errors properly either in that the files matching the glob were deleted instead of left alone.
Here is a safe replacement you can substitute for the line with jpegoptim:
IFS=$'\n'
for f in $(find $(pwd) -maxdepth 1 -name "*.jpg")
do
jpegoptim --strip-all "$f"
done