Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image-optimization.sh: jpegoptim doesn't accept glob patterns; error causes images to be deleted #3186

Closed
SentToDevNull opened this issue Jan 20, 2017 · 1 comment
Labels
bug good first issue Small tasks with clear documentation about how and in which place you need to fix things in.
Milestone

Comments

@SentToDevNull
Copy link

SentToDevNull commented Jan 20, 2017

Steps to reproduce

  1. 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
@SentToDevNull SentToDevNull changed the title jpegoptim doesn't accept glob patterns; error causes images to be deleted image-optimization.sh: jpegoptim doesn't accept glob patterns; error causes images to be deleted Jan 20, 2017
@nickvergessen
Copy link
Member

That file should also not be in that directory...

@nickvergessen nickvergessen added bug good first issue Small tasks with clear documentation about how and in which place you need to fix things in. labels Jan 23, 2017
@MorrisJobke MorrisJobke added this to the Nextcloud 13 milestone Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Small tasks with clear documentation about how and in which place you need to fix things in.
Projects
None yet
Development

No branches or pull requests

3 participants