-1

I use mogrify as such:

mogrify -monitor -quality 80 -resize 1200 *JPG

However, this only matches files ending in .JPG. How do I include .jpg files at the same time (in other words, how to make the pattern case-insensitive)?

  • Yes it does! But not the accepted answer because that is about configuring it more permanently whereas I only want to use it once. This works it seems: *.[jJ][pP][gG] instead of .JPG. If you post it as an answer I can accept. –  Jan 12 '22 at 21:39

1 Answers1

1

Simply append the new filenames mogrify -monitor -quality 80 -resize 1200 *.JPG *.jpg. The wildcards are expanded by the shell before mogrify starts.

If you have the possibility of extensions like *.JpG, filenames with spaces, etc, use

find . -maxdepth 1 -type f -iname '*.jpg' -print0 |\
xargs -0 --no-run-if-empty mogrify -monitor  -quality 80 -resize 1200

Read man find xargs.

waltinator
  • 4,865