~schnouki/schnouki.net

8a755af66a26cbb5d403215aaf1897f850c1d526 — Thomas Jost 2 months ago fd6f14f master
Add WebP content
53 files changed, 43 insertions(+), 0 deletions(-)

A content/book-review/2020/Comment je suis devenue anarchiste/cover.webp
A content/book-review/2020/Fées, weed et guillotines/cover.webp
A content/book-review/2020/Hackers: Heroes of the Computer Revolution/cover.webp
A content/portfolio/buddycloud/buddycloud.webp
A content/portfolio/buddycloud/tshirt.webp
A content/portfolio/findspire/logo-400.webp
A content/portfolio/findspire/logo.webp
A content/portfolio/findspire/player.webp
A content/portfolio/findspire/screenshot1.webp
A content/portfolio/findspire/screenshot2.webp
A content/portfolio/findspire/screenshot3.webp
A content/portfolio/stibidik/logo-400.webp
A content/portfolio/stibidik/logo.webp
A content/portfolio/stibidik/screenshot-market-20180111.webp
A content/portfolio/stibidik/screenshot-market-20180623.webp
A content/portfolio/stibidik/screenshot-market-20180718.webp
A content/portfolio/stibidik/screenshot-market-search.webp
A content/portfolio/stibidik/screenshot-shopify-20180723.webp
A content/portfolio/stibidik/screenshot-wanted.webp
A content/post/2018/2018-11-08 Highlighting Hugo shortcodes in Emacs/shortcode-bad.webp
A content/post/2018/2018-11-08 Highlighting Hugo shortcodes in Emacs/shortcode-good.webp
A content/post/2019/2019-09-23 How to use a Keychron K2 USB keyboard on Linux/KeychronK2.webp
A content/post/2020/2020-01-16 How to run a Win10 dev VM on VirtualBox 5/screenshot.webp
A content/post/2020/2020-12-01 Advent of Code 2020, day 1/aoc.webp
A static/android-chrome-192x192.webp
A static/android-chrome-512x512.webp
A static/apple-touch-icon.webp
A static/favicon-16x16.webp
A static/img/2009/before_the_internet.webp
A static/img/2009/google_adZs_vampire.webp
A static/img/2009/hey_jude.webp
A static/img/2009/loria1.webp
A static/img/2009/loria2.webp
A static/img/2009/loria3.webp
A static/img/2009/parco2009_bocuse.webp
A static/img/2009/qc240.webp
A static/img/2009/win7_car.webp
A static/img/2010/jonsi-go-cover.webp
A static/img/2014/chromecast/discover_global.webp
A static/img/2014/chromecast/discover_vpnns_no_reflector.webp
A static/img/2014/chromecast/discover_vpnns_reflector.webp
A static/img/2014/chromecast/result.webp
A static/img/2014/tlsa-url.webp
A static/img/2015/git-branch-last-commit.webp
A static/img/gopher-full.webp
A static/img/gopher.webp
A static/img/thomas-200.webp
A static/img/thomas-full.webp
A static/mstile-150x150.webp
A static/mstile-310x150.webp
A static/mstile-310x310.webp
A static/mstile-70x70.webp
A webpize
A content/book-review/2020/Comment je suis devenue anarchiste/cover.webp => content/book-review/2020/Comment je suis devenue anarchiste/cover.webp +0 -0
A content/book-review/2020/Fées, weed et guillotines/cover.webp => content/book-review/2020/Fées, weed et guillotines/cover.webp +0 -0
A content/book-review/2020/Hackers: Heroes of the Computer Revolution/cover.webp => content/book-review/2020/Hackers: Heroes of the Computer Revolution/cover.webp +0 -0
A content/portfolio/buddycloud/buddycloud.webp => content/portfolio/buddycloud/buddycloud.webp +0 -0
A content/portfolio/buddycloud/tshirt.webp => content/portfolio/buddycloud/tshirt.webp +0 -0
A content/portfolio/findspire/logo-400.webp => content/portfolio/findspire/logo-400.webp +0 -0
A content/portfolio/findspire/logo.webp => content/portfolio/findspire/logo.webp +0 -0
A content/portfolio/findspire/player.webp => content/portfolio/findspire/player.webp +0 -0
A content/portfolio/findspire/screenshot1.webp => content/portfolio/findspire/screenshot1.webp +0 -0
A content/portfolio/findspire/screenshot2.webp => content/portfolio/findspire/screenshot2.webp +0 -0
A content/portfolio/findspire/screenshot3.webp => content/portfolio/findspire/screenshot3.webp +0 -0
A content/portfolio/stibidik/logo-400.webp => content/portfolio/stibidik/logo-400.webp +0 -0
A content/portfolio/stibidik/logo.webp => content/portfolio/stibidik/logo.webp +0 -0
A content/portfolio/stibidik/screenshot-market-20180111.webp => content/portfolio/stibidik/screenshot-market-20180111.webp +0 -0
A content/portfolio/stibidik/screenshot-market-20180623.webp => content/portfolio/stibidik/screenshot-market-20180623.webp +0 -0
A content/portfolio/stibidik/screenshot-market-20180718.webp => content/portfolio/stibidik/screenshot-market-20180718.webp +0 -0
A content/portfolio/stibidik/screenshot-market-search.webp => content/portfolio/stibidik/screenshot-market-search.webp +0 -0
A content/portfolio/stibidik/screenshot-shopify-20180723.webp => content/portfolio/stibidik/screenshot-shopify-20180723.webp +0 -0
A content/portfolio/stibidik/screenshot-wanted.webp => content/portfolio/stibidik/screenshot-wanted.webp +0 -0
A content/post/2018/2018-11-08 Highlighting Hugo shortcodes in Emacs/shortcode-bad.webp => content/post/2018/2018-11-08 Highlighting Hugo shortcodes in Emacs/shortcode-bad.webp +0 -0
A content/post/2018/2018-11-08 Highlighting Hugo shortcodes in Emacs/shortcode-good.webp => content/post/2018/2018-11-08 Highlighting Hugo shortcodes in Emacs/shortcode-good.webp +0 -0
A content/post/2019/2019-09-23 How to use a Keychron K2 USB keyboard on Linux/KeychronK2.webp => content/post/2019/2019-09-23 How to use a Keychron K2 USB keyboard on Linux/KeychronK2.webp +0 -0
A content/post/2020/2020-01-16 How to run a Win10 dev VM on VirtualBox 5/screenshot.webp => content/post/2020/2020-01-16 How to run a Win10 dev VM on VirtualBox 5/screenshot.webp +0 -0
A content/post/2020/2020-12-01 Advent of Code 2020, day 1/aoc.webp => content/post/2020/2020-12-01 Advent of Code 2020, day 1/aoc.webp +0 -0
A static/android-chrome-192x192.webp => static/android-chrome-192x192.webp +0 -0
A static/android-chrome-512x512.webp => static/android-chrome-512x512.webp +0 -0
A static/apple-touch-icon.webp => static/apple-touch-icon.webp +0 -0
A static/favicon-16x16.webp => static/favicon-16x16.webp +0 -0
A static/img/2009/before_the_internet.webp => static/img/2009/before_the_internet.webp +0 -0
A static/img/2009/google_adZs_vampire.webp => static/img/2009/google_adZs_vampire.webp +0 -0
A static/img/2009/hey_jude.webp => static/img/2009/hey_jude.webp +0 -0
A static/img/2009/loria1.webp => static/img/2009/loria1.webp +0 -0
A static/img/2009/loria2.webp => static/img/2009/loria2.webp +0 -0
A static/img/2009/loria3.webp => static/img/2009/loria3.webp +0 -0
A static/img/2009/parco2009_bocuse.webp => static/img/2009/parco2009_bocuse.webp +0 -0
A static/img/2009/qc240.webp => static/img/2009/qc240.webp +0 -0
A static/img/2009/win7_car.webp => static/img/2009/win7_car.webp +0 -0
A static/img/2010/jonsi-go-cover.webp => static/img/2010/jonsi-go-cover.webp +0 -0
A static/img/2014/chromecast/discover_global.webp => static/img/2014/chromecast/discover_global.webp +0 -0
A static/img/2014/chromecast/discover_vpnns_no_reflector.webp => static/img/2014/chromecast/discover_vpnns_no_reflector.webp +0 -0
A static/img/2014/chromecast/discover_vpnns_reflector.webp => static/img/2014/chromecast/discover_vpnns_reflector.webp +0 -0
A static/img/2014/chromecast/result.webp => static/img/2014/chromecast/result.webp +0 -0
A static/img/2014/tlsa-url.webp => static/img/2014/tlsa-url.webp +0 -0
A static/img/2015/git-branch-last-commit.webp => static/img/2015/git-branch-last-commit.webp +0 -0
A static/img/gopher-full.webp => static/img/gopher-full.webp +0 -0
A static/img/gopher.webp => static/img/gopher.webp +0 -0
A static/img/thomas-200.webp => static/img/thomas-200.webp +0 -0
A static/img/thomas-full.webp => static/img/thomas-full.webp +0 -0
A static/mstile-150x150.webp => static/mstile-150x150.webp +0 -0
A static/mstile-310x150.webp => static/mstile-310x150.webp +0 -0
A static/mstile-310x310.webp => static/mstile-310x310.webp +0 -0
A static/mstile-70x70.webp => static/mstile-70x70.webp +0 -0
A webpize => webpize +43 -0
@@ 0,0 1,43 @@
#!/usr/bin/env bash

set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT

tmpf=$(mktemp --suffix=.webp)


cleanup() {
    trap - SIGINT SIGTERM ERR EXIT
    rm -f "$tmpf"
}

setup_colors() {
  if [[ -t 2 ]] && [[ -z "${NO_COLOR-}" ]] && [[ "${TERM-}" != "dumb" ]]; then
    NOFORMAT='\033[0m' RED='\033[0;31m' GREEN='\033[0;32m' ORANGE='\033[0;33m' BLUE='\033[0;34m' PURPLE='\033[0;35m' CYAN='\033[0;36m' YELLOW='\033[1;33m'
  else
    NOFORMAT='' RED='' GREEN='' ORANGE='' BLUE='' PURPLE='' CYAN='' YELLOW=''
  fi
}

msg() {
  echo >&2 -e "${1-}"
}

setup_colors

find . -iname '*.jpg' -or -iname '*.png' |
    while read src; do
        dst="${src%.???}.webp"
        if ! [[ -e "$dst" ]]; then
            truncate -s0 "$tmpf"
            convert "$src" "$tmpf"
            szs=$(stat -c %s "$src")
            szd=$(stat -c %s "$tmpf")
            if [[ $szs -gt $szd ]]; then
                msg "$src: $szs --> ${GREEN}$szd${NOFORMAT}"
                cp "$tmpf" "$dst"
            else
                msg "$src: $szs --> ${YELLOW}$szd${NOFORMAT}"
            fi
        fi
    done