Quantcast
Channel: Matthias Pospiech » Bash
Viewing all articles
Browse latest Browse all 10

convert Images in batch process

$
0
0

Converting images in a batch process is not difficult in general, but approaches like this fail at filenames/directories with spaces

#!/bin/sh 
for file in $(find -iname *.bmp); 
do 
mogrify -verbose -format png $file;
done

The solution is to use ‘read’ in the following way

#!/bin/sh 
find . -iname "*.bmp" | while read name; do  mogrify -verbose -format png "$name"; done

which converts all *bmp to *.png in the folder and all of its subfolders.


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images