Skip to content

Instantly share code, notes, and snippets.

Last active September 23, 2016 06:02
What would you like to do?
Deskew a folder of images w/ deskew tool
// binary deskew (depends on platform)
if [ -f "$bin" ]
// necessary on linux (other platforms ?) to use it
chmod +x deskew
echo "creting output folder"
// warning - overwrites existing
mkdir -p ./output;
// listing files in input and iterating
for file in ./input/*
if [[ -f $file ]]; then
echo "processing $file"
filename=$(basename "$file")
// processing file with deskew
./deskew -o "./output/$filename" $file
echo "$bin is not there, leaving."
  • download deskew tool ( and copy from the Bin folder the binary corresponding to your platform to the parent directory of your images directory
  • download/copy the bash script of this gist and put it in the parent directory of your images directory
  • rename your images directory to input (or change that in the script ! :)
  • make sure there is no output directory in your parent folder, because the script is going to overwrite it if it exists
  • if on linux change rights of the script : chmod +x
  • run the script : ./
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment