Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
executable file 28 lines (21 sloc) 683 Bytes
#!/usr/bin/env bash
# normalize-gifs.rb
# Author: William Woodruff
# ------------------------
# Normalize the supplied GIFs to the resolution specified by DIMS.
# Requires gifsicle.
# ------------------------
# This code is licensed by William Woodruff under the MIT License.
# http://opensource.org/licenses/MIT
installed() {
cmd=$(command -v "${1}")
[[ -n "${cmd}" ]] && [[ -f "${cmd}" ]]
return ${?}
}
installed gifsicle || { echo "I need gifsicle to normalize GIFs."; exit 1; }
DIMS=${DIMS:-300x300}
mkdir -p "${DIMS}"
for gif in "${@}"; do
echo "Normalizing ${gif}..."
gifsicle -w --colors 256 --resize "${DIMS}" "${gif}" > "${DIMS}/$(basename "${gif}")"
done
You can’t perform that action at this time.