Skip to content

Instantly share code, notes, and snippets.

@valentinvieriu
Created December 10, 2013 19:20
Show Gist options
  • Save valentinvieriu/7896480 to your computer and use it in GitHub Desktop.
Save valentinvieriu/7896480 to your computer and use it in GitHub Desktop.
#!/bin/bash
width=60;
height=60;
x_offset=10;
y_offset=5;
filelist=`ls | grep '.jpg'`
for image_file in $filelist
do
preextensionfilename=`convert $image_file -format "%t" info:`
convert $image_file -crop ${width}x${height}+${x_offset}+${y_offset} \
${preextensionfilename}_${width}x${height}.jpg
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment