Packages

Mix tasks and library for converting jpeg, png, etc images to webp

Current section

Files

Jump to
webp lib priv webp.bash
Raw

lib/priv/webp.bash

#!/usr/bin/env bash
exec "$@" &
pid1=$!
# Silence warnings from here on
exec >/dev/null 2>&1
# Read from stdin in the background and
# kill running program when stdin closes
exec 0<&0 $(
while read; do :; done
kill -KILL $pid1
) &
pid2=$!
# Clean up
wait $pid1
ret=$?
kill -KILL $pid2
exit $ret