summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2013-09-02 09:41:42 -0400
committerAlex Xu <alex_y_xu@yahoo.ca>2013-09-02 09:41:42 -0400
commitfafc904d0e8b5a76577f16700c123af684176fdc (patch)
treede9db5e5cbbfb4836e90671f4cbe8dff22b93447
parent865c122aa1d991860486370c65319c5f9264559f (diff)
downloadhtml5ks-fafc904d0e8b5a76577f16700c123af684176fdc.tar.xz
html5ks-fafc904d0e8b5a76577f16700c123af684176fdc.zip
Don't overwrite files when encoding.
-rwxr-xr-xiencode.sh11
-rwxr-xr-xvencode.sh4
-rw-r--r--www/css/index.css1
3 files changed, 13 insertions, 3 deletions
diff --git a/iencode.sh b/iencode.sh
index 990d027..460db3b 100755
--- a/iencode.sh
+++ b/iencode.sh
@@ -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
diff --git a/vencode.sh b/vencode.sh
index d29b52c..aff9f4c 100755
--- a/vencode.sh
+++ b/vencode.sh
@@ -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;