Batch image cropping
Today I decided to prepare new gallery for Behemoth`s Lair Heroes 3 service. The very first step I have to take was to thumbnail existing images that each will fit exactly 100 x 100 dimensions and keep it`s original ratio. With PHP I would use IMagick::cropThumbnail() which do exactly what I need. IMagick uses Image Magic and so do I :) Beneth you will find results of my research: this code will create thumbnails for all JPG images from current directory and save them into thumb subdirectory.
find . -maxdepth 1 -iname '*jpg' -exec convert {} -thumbnail 100x100^ -gravity Center -crop 100x100-0-0 thumb/{} \;
Yhm, a czemu tak z find kombinujesz, nie wystarczy mogrify z maską? ;)
Nie jestem guru basha – może to co mówisz wystarczy, ale ja o tym nie wiem ;-)
Pozdrawiam
Ale to nie bash: http://www.linuxtutorialblog.com/post/cropping-multiple-images-the-same-way-short-tutorial
Nie trzeba tak kombinować. ;)