You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
require assert/command
|
|
|
|
assert_command jpegtran
|
|
|
|
min_jpg() (
|
|
for FILE in "$@"; do
|
|
PERMISSIONS=$(stat --format '%a' "${FILE}")
|
|
OUT_FILE=$(mktemp)
|
|
jpegtran -optimize -perfect -outfile "${OUT_FILE}" "${FILE}"
|
|
mv "${OUT_FILE}" "${FILE}"
|
|
chmod "${PERMISSIONS}" "${FILE}"
|
|
done
|
|
)
|