- index="$_DATA/${ITEM%/*}/.index"
- thumb="$index/${ITEM##*/}"; thumb="${thumb%.*}.jpg"
- [ -d "$index" -a \! -f "$thumb" ] \
- && file="$_DATA/$ITEM" . "$_EXEC/thumbnail.sh"
+ . "$_EXEC/thumbnail.sh"
+ index="$_DATA/${PATH_INFO%/*}/.index"
+ thumb="$index/${PATH_INFO##*/}"; thumb="${thumb%.*}.jpg"
+ [ -d "$index" -a ! -f "$thumb" ] \
+ && { printf %s "$PATH_INFO" |grep -qE -e "${file_pattern}" ;} \
+ && gen_thumb "$_DATA/$PATH_INFO" "$thumb"