diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2013-09-02 09:41:42 -0400 |
---|---|---|
committer | Alex Xu <alex_y_xu@yahoo.ca> | 2013-09-02 09:41:42 -0400 |
commit | fafc904d0e8b5a76577f16700c123af684176fdc (patch) | |
tree | de9db5e5cbbfb4836e90671f4cbe8dff22b93447 | |
parent | 865c122aa1d991860486370c65319c5f9264559f (diff) | |
download | html5ks-fafc904d0e8b5a76577f16700c123af684176fdc.tar.xz html5ks-fafc904d0e8b5a76577f16700c123af684176fdc.zip |
Don't overwrite files when encoding.
-rwxr-xr-x | iencode.sh | 11 | ||||
-rwxr-xr-x | vencode.sh | 4 | ||||
-rw-r--r-- | www/css/index.css | 1 |
3 files changed, 13 insertions, 3 deletions
@@ -5,6 +5,8 @@ CWEBP=cwebp # configure flags CWEBP_FLAGS="-m 6" +set -e + cd $(dirname $0)/www/dump iencode() { @@ -15,9 +17,16 @@ iencode() { find . -name \*."${EXT}" -print0 | xargs -0 -P ${THREADS} -n 1 bash -c ' IN="$0" OUT="${IN%.${EXT}}.webp" - ${CWEBP} -q "${QUAL}" ${CWEBP_FLAGS} ${IN} -o ${OUT} + [[ -f ${OUT} ]] || ${CWEBP} -q "${QUAL}" ${CWEBP_FLAGS} ${IN} -o ${OUT} ' } iencode jpg 90 iencode png 99 + +if hash zopflipng; then + find . -name \*.png -print0 | xargs -0 -I '{}' -P ${THREADS} zopflipng -my '{}' '{}' +else + echo >&2 "Install zopfli (https://code.google.com/p/zopfli/) to improve PNG compression." + echo >&2 "Approximately 2% savings can be seen across the board, with no cost to quality." +fi @@ -3,7 +3,7 @@ # configure ffmpeg location if not in PATH FFMPEG=ffmpeg # configure flags -FFMPEG_FLAGS="-y" +FFMPEG_FLAGS="" set -e @@ -11,7 +11,7 @@ cd $(dirname $0)/www/dump/video vencode() { set -x - ${FFMPEG} -threads ${THREADS} -i "$1" -c:v "$2" $3 ${FFMPEG_FLAGS} "$4" + [[ -f $4 ]] || ${FFMPEG} -threads ${THREADS} -i "$1" -c:v "$2" $3 ${FFMPEG_FLAGS} "$4" } for f in *.mkv; do diff --git a/www/css/index.css b/www/css/index.css index 6d1264c..fba9bf3 100644 --- a/www/css/index.css +++ b/www/css/index.css @@ -156,6 +156,7 @@ html.no-js #gotit { } #nvlctc { bottom: 25px; + transform: rotate(90deg); } #centered { text-align: center; |