#! /bin/bash
# Last edited on 2024-03-30 11:16:41 by stolfi

usage="$0 DIR.."

# Finds image files in the given directories (default the current directory)
# Will list symbolic links, but will not search beyond them.

if [[ $# -gt 0 ]]; then
  dirs=( "$@" )
else
  dirs=( ./ )
fi

find ${dirs[@]} \
  \( -type f -o -type l \) \
  \( -name '*.jpg*'  -o -name '*.JPG*'  -o -name '*.jpeg*' -o -name '*.JPEG*' -o \
     -name '*.webp*' -o -name '*.WEBP*' -o -name '*.WebP*' -o \
     -name '*.tif*'  -o -name '*.TIF*'  -o \
     -name '*.gif*'  -o -name '*.GIF*'  -o \
     -name '*.ppm*'  -o -name '*.PPM*'  -o \
     -name '*.pgm*'  -o -name '*.PGM*'  -o \
     -name '*.png*'  -o -name '*.PNG*'  -o \
     -name '*.bmp*'  -o -name '*.BMP*'  -o \
     -name '*.tga*'  -o -name '*.TGA* ' \) \
  -print \
  | sort

     
  


