6 SCRIPT_DIR
="$( cd "$
( dirname "${BASH_SOURCE[0]}" )" && pwd )"
17 local output
=$
(mktemp
)
18 local starts_with_dash
=0
19 local tmp_file_name
=""
21 # zopfli freaks out for things that start with a dash, so we need to
23 if [[ ${input} = -* ]]; then
25 tmp_file_name
=$
(mktemp
)
26 cp -- ${input} ${tmp_file_name}
27 input
=${tmp_file_name}
30 zopflipng
-m --iterations=15 --filters=0meb
${input} ${output}
31 if [[ -f ${output} ]]; then
32 mv -- "${output}" "${i}"
35 if [[ -n ${tmp_file_name} ]]; then
36 rm -f ${tmp_file_name};
46 if [[ -n ${1} ]]; then
51 for i
in $
(find "${SCRIPT_DIR}/../public" -name '*.png' -exec dirname {} \
;|
sort -ur); do