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

Enhancement (gallery): Include .gif images in gallery #22

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions webize
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ if [ "$DIR" = '.' ]; then
fi

# Get directories with images
IMAGES_REGEX='\.gif|\.jpg|\.png|\.svg|\.webp'
dirs=$(
find "$DIR" -type d | while read -r d; do
if ls -p "$d" | grep -v '/' | grep -E '\.png|\.jpg|\.webp|\.svg' > /dev/null; then
if ls -p "$d" | grep -v '/' | grep -E "$IMAGES_REGEX" > /dev/null; then
echo "$d"
fi
done | sort -n
Expand All @@ -98,7 +99,7 @@ if [ -n "$GALLERY" ]; then
files=$( ls -al --time-style='+%Y-%m-%dT%H:%M:%S%z' -p "$d" )
fi

echo "$files" | grep -v '/' | grep -E '\.png|\.jpg|\.webp|\.svg' | while read -r l; do
echo "$files" | grep -v '/' | grep -E "$IMAGES_REGEX" | while read -r l; do
size=$( echo "$l" | awk '{print $5}' )
dateiso=$( echo "$l" | awk '{print $6}' )
filename=$( echo "$l" | awk '{print $1=$2=$3=$4=$5=$6=""; print $0}' | awk NF | sed 's/^[ ]*//g' )
Expand Down