DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Howto Resize Multiple Pictures, Graphics, Images

04.29.2008
| 10662 views |
  • submit to reddit
        
for k in $(ls *.jpg); do convert -resize 800 -quality 80 $k r800-$k; done
    

Comments

Snippets Manager replied on Tue, 2010/06/29 - 9:25am

Very well but what if I would like to have my picture's size exactly 130x98 (image's proportions may be changed - it may be stretched or narrowed). If I write something like: for k in $(ls *.gif); do convert $k -resize 130x98 -quality 80 a$k; done I have images 130x77 or 130x89 or 88x98 and so...