bash Command for ImageMagick Mass Conversion

Language butchery by Mr Rich on  28.7.10 @ 15:20

for file in `ls -1 [source-dir]`; do convert [source-dir]/$file -monitor -resize 784 +repage [destination-dir]/$file; done


Example out:

$> for file in `ls -1 raw/ssh-keygen`; do convert raw/ssh-keygen/$file -monitor -resize 784 +repage 784wide/ssh-keygen/$file; done
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-01-windows-command-prompt-01.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-02-windows-command-prompt-02.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-03-windows-command-prompt-03.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-04-windows-command-prompt-04.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-05-mac-admin-access-01.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-06-mac-terminal-02.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-07-mac-terminal-03.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-08-mac-terminal-04.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-09-linux-terminal-01.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-10-linux-terminal-02.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-11-linux-terminal-03.png]
Resize/Image/raw/ssh-keygen: 100% [ssh-key-gen-12-linux-terminal-04.png]


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?