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.

31 lines
631 B
Bash

#!/usr/bin/env bash
#ft=bash
function min-jpg {
if ! command -v jpegtran &> /dev/null ; then
echo "jpegtran not installed"
fi
tmpfile="$(mktemp)"
ogfile="$1"
jpegtran -optimize -perfect -outfile "$tmpfile" "$ogfile"
mv "$tmpfile" "$ogfile"
}
function min-png {
if ! command -v pngcrush &> /dev/null ; then
echo "pngcrush not installed"
fi
tmpfile="$(mktemp)"
ogfile="$1"
pngcrush -rem alla -reduce -brute "$ogfile" "$tmpfile"
mv "$tmpfile" "$ogfile"
}
function get-create-date {
date -r "$1" +"%F"
}
function add-date-prefix {
add_date_prefix "$1" "$2"
}