Skip to content

Instantly share code, notes, and snippets.

@Meettya
Created January 28, 2012 16:24
Show Gist options
  • Save Meettya/1694918 to your computer and use it in GitHub Desktop.
Save Meettya/1694918 to your computer and use it in GitHub Desktop.
simply paralell bash bath image resizer
#!/bin/bash
#===================================
#
# This command resize all images
# in this dir and all sub dirs
# For common purpose.
#
# GNU Parallel version
# http://www.gnu.org/software/parallel/
# http://software.opensuse.org/download.html?project=home:tange&package=parallel
#
# usage:
# convert-bath.sh dirname
#
# (C) Meettya winter 2012
#===================================
prefix="res_"
size="1920x1080>"
if [ -d "$1" ]; then
find "$1" -type f ! -name "$prefix*" ! -name "*.txt" ! -name "*.db" |
parallel "echo {}; convert {} -adaptive-resize '$size' {//}/'$prefix'{/}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment