Convert all jpg pictures to webp
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Before Width: | Height: | Size: 11 KiB |
BIN
js/public/img/categories/arts-small.webp
Normal file
After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 38 KiB |
BIN
js/public/img/categories/arts.webp
Normal file
After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 5.1 KiB |
BIN
js/public/img/categories/business-small.webp
Normal file
After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 17 KiB |
BIN
js/public/img/categories/business.webp
Normal file
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 12 KiB |
BIN
js/public/img/categories/crafts-small.webp
Normal file
After Width: | Height: | Size: 9 KiB |
Before Width: | Height: | Size: 44 KiB |
BIN
js/public/img/categories/crafts.webp
Normal file
After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 6.1 KiB |
BIN
js/public/img/categories/film_media-small.webp
Normal file
After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 16 KiB |
BIN
js/public/img/categories/film_media.webp
Normal file
After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 7.2 KiB |
BIN
js/public/img/categories/food_drink-small.webp
Normal file
After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 21 KiB |
BIN
js/public/img/categories/food_drink.webp
Normal file
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8 KiB |
BIN
js/public/img/categories/games-small.webp
Normal file
After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 20 KiB |
BIN
js/public/img/categories/games.webp
Normal file
After Width: | Height: | Size: 9 KiB |
Before Width: | Height: | Size: 6.1 KiB |
BIN
js/public/img/categories/health-small.webp
Normal file
After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 15 KiB |
BIN
js/public/img/categories/health.webp
Normal file
After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 8.7 KiB |
BIN
js/public/img/categories/lgbtq-small.webp
Normal file
After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 24 KiB |
BIN
js/public/img/categories/lgbtq.webp
Normal file
After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 7.5 KiB |
BIN
js/public/img/categories/movements_politics-small.webp
Normal file
After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 20 KiB |
BIN
js/public/img/categories/movements_politics.webp
Normal file
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 7.1 KiB |
BIN
js/public/img/categories/music-small.webp
Normal file
After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 18 KiB |
BIN
js/public/img/categories/music.webp
Normal file
After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 8.6 KiB |
BIN
js/public/img/categories/outdoors_adventure-small.webp
Normal file
After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 29 KiB |
BIN
js/public/img/categories/outdoors_adventure.webp
Normal file
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 2.7 KiB |
BIN
js/public/img/categories/party-small.webp
Normal file
After Width: | Height: | Size: 776 B |
Before Width: | Height: | Size: 5.8 KiB |
BIN
js/public/img/categories/party.webp
Normal file
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
BIN
js/public/img/categories/photography-small.webp
Normal file
After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 19 KiB |
BIN
js/public/img/categories/photography.webp
Normal file
After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 32 KiB |
BIN
js/public/img/categories/spirituality_religion_beliefs.webp
Normal file
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 7.8 KiB |
BIN
js/public/img/categories/sports-small.webp
Normal file
After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 22 KiB |
BIN
js/public/img/categories/sports.webp
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 13 KiB |
BIN
js/public/img/categories/theatre-small.webp
Normal file
After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 54 KiB |
BIN
js/public/img/categories/theatre.webp
Normal file
After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 9.9 KiB |
BIN
js/public/img/online-event.webp
Normal file
After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 725 KiB |
BIN
js/public/img/pics/error.webp
Normal file
After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 1.2 MiB |
BIN
js/public/img/pics/event_creation.webp
Normal file
After Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 379 KiB |
BIN
js/public/img/pics/footer_1.webp
Normal file
After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 359 KiB |
BIN
js/public/img/pics/footer_2.webp
Normal file
After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 376 KiB |
BIN
js/public/img/pics/footer_3.webp
Normal file
After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 358 KiB |
BIN
js/public/img/pics/footer_4.webp
Normal file
After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 518 KiB |
BIN
js/public/img/pics/footer_5.webp
Normal file
After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 1.2 MiB |
BIN
js/public/img/pics/group.webp
Normal file
After Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 1.8 MiB |
BIN
js/public/img/pics/homepage.webp
Normal file
After Width: | Height: | Size: 317 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 1.5 MiB |
BIN
js/public/img/pics/realisation.webp
Normal file
After Width: | Height: | Size: 222 KiB |
Before Width: | Height: | Size: 133 KiB |
BIN
js/public/img/pics/rose.webp
Normal file
After Width: | Height: | Size: 21 KiB |
|
@ -30,11 +30,6 @@ convert_image () {
|
|||
convert -geometry "$resolution"x $file $output
|
||||
}
|
||||
|
||||
produce_webp () {
|
||||
name=$(file_name)
|
||||
output="$output_dir/$name.webp"
|
||||
cwebp $file -quiet -o $output
|
||||
}
|
||||
|
||||
progress() {
|
||||
local w=80 p=$1; shift
|
||||
|
@ -68,23 +63,3 @@ do
|
|||
fi
|
||||
done
|
||||
echo -e "\nDone!"
|
||||
|
||||
echo "Generating optimized versions of the pictures…"
|
||||
|
||||
if ! command -v cwebp &> /dev/null
|
||||
then
|
||||
echo "$(tput setaf 1)ERROR: The cwebp command could not be found. You need to install webp.$(tput sgr 0)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
nb_files=$( shopt -s nullglob ; set -- $output_dir/* ; echo $#)
|
||||
i=1
|
||||
for file in $output_dir/*
|
||||
do
|
||||
if [[ -f $file ]]; then
|
||||
produce_webp
|
||||
progress $(($i*100/$nb_files)) still working...
|
||||
i=$((i+1))
|
||||
fi
|
||||
done
|
||||
echo -e "\nDone!"
|
|
@ -15,17 +15,17 @@
|
|||
class="brightness-50"
|
||||
>
|
||||
<source
|
||||
:srcset="`/img/categories/${category.key.toLowerCase()}.jpg 2x, /img/categories/${category.key.toLowerCase()}.jpg`"
|
||||
:srcset="`/img/categories/${category.key.toLowerCase()}.webp 2x, /img/categories/${category.key.toLowerCase()}.webp`"
|
||||
media="(min-width: 1000px)"
|
||||
/>
|
||||
<source
|
||||
:srcset="`/img/categories/${category.key.toLowerCase()}.jpg 2x, /img/categories/${category.key.toLowerCase()}-small.jpg`"
|
||||
:srcset="`/img/categories/${category.key.toLowerCase()}.webp 2x, /img/categories/${category.key.toLowerCase()}-small.webp`"
|
||||
media="(min-width: 300px)"
|
||||
/>
|
||||
<img
|
||||
class="w-full h-36 w-36 md:h-52 md:w-52 object-cover"
|
||||
:src="`/img/categories/${category.key.toLowerCase()}.jpg`"
|
||||
:srcset="`/img/categories/${category.key.toLowerCase()}-small.jpg `"
|
||||
:src="`/img/categories/${category.key.toLowerCase()}.webp`"
|
||||
:srcset="`/img/categories/${category.key.toLowerCase()}-small.webp `"
|
||||
width="384"
|
||||
height="384"
|
||||
alt=""
|
||||
|
|
|
@ -8,13 +8,8 @@
|
|||
:srcset="`/img/pics/error-480w.webp 1x, /img/pics/error-1024w.webp 2x`"
|
||||
type="image/webp"
|
||||
/>
|
||||
<source
|
||||
:srcset="`/img/pics/error-480w.jpg 1x, /img/pics/error-1024w.jpg 2x`"
|
||||
type="image/jpeg"
|
||||
/>
|
||||
|
||||
<img
|
||||
:src="`/img/pics/error-480w.jpg`"
|
||||
:src="`/img/pics/error-480w.webp`"
|
||||
alt=""
|
||||
width="480"
|
||||
height="312"
|
||||
|
|