Skip to content

Instantly share code, notes, and snippets.

@grisu48
Last active May 28, 2019 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grisu48/e087bd1096c38b5560a5c4ec54578dc0 to your computer and use it in GitHub Desktop.
Save grisu48/e087bd1096c38b5560a5c4ec54578dc0 to your computer and use it in GitHub Desktop.
Bash function to trim pictures using imagemagick
#!/bin/bash
# Bash function to trim pictures using imagemagick
# This snippet is meant to be inserted as function in ~/.bashrc
ctrim() {
if [ $# -lt 1 ]; then
echo "ctrim - trim the given pictures (using convert --trim)"
else
# TODO: Parallel runs
for i in $@; do
convert -trim "$i" "$i"
done
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment