Skip to content

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

@SentToDevNull

Description

@SentToDevNull

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issueSmall tasks with clear documentation about how and in which place you need to fix things in.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions