Lambdacurry

script-fu: find all images and rename them, attaching resolution information to filename


dont ask

[sourcecode lang=“bash”] find . -name \*image\* -exec sh -vc ’ cp {} `echo {} |xargs basename| sed “s@\(.*\)\.jpg\|png\|bmp@\1@”`__`identify -verbose {} | grep Geometry | sed -e “s@^.*Geometry: \([0-9]*\)\([x]*\)\([0-9]*\).*@__\1_\3@”`.`echo {} | sed “s@\(.*\)\.\(jpg\|png\|bmp\)@\2@”` ’ \; [/sourcecode]


Lambdacurry

script-fu: find all images and rename them, attaching resolution information to filename

Published

June 18, 2010

Find me on Twitter @sandeepssrin

Did i make any mistake? Please consider sending a pull request.