Created
December 30, 2018 17:46
-
-
Save yu81/5ecebad58e7f40825ae5f6c1f9f57244 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# :eyes: https://github.com/tgagor/docker-jpegtran | |
function jpegtran_docker { | |
[ $(docker images jpegtran | wc -l) != 2 ] && return 1 # ahead of this, build jpegtran with https://github.com/tgagor/docker-jpegtran.git | |
local file=$1 | |
[ -z $file ] && return 1 | |
local filedir=$(dirname ${file}) | |
[ ${filedir} = "." ] && filedir=$(pwd) | |
local f=$(basename ${file}) | |
local mount_volumes=${filedir}:/tmp | |
docker run -v ${mount_volumes} jpegtran jpegtran -copy all -debug -optimize -outfile "/tmp/${f}" "/tmp/${f}" | |
return $? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment