Skip to content

Commit

Permalink
Merge pull request #22 from theohbrothers/enhancement/gallery-include…
Browse files Browse the repository at this point in the history
…-.gif-images-in-gallery

Enhancement (gallery): Include .gif images in gallery
  • Loading branch information
leojonathanoh authored Aug 27, 2021
2 parents a943cf3 + 4b7ba25 commit 0cd56fe
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 0cd56fe

Please sign in to comment.