nav-left cat-right
Matthias Pospiech > Linux > convert Images in batch process

convert Images in batch process

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

for file in $(find -iname *.bmp); 
mogrify -verbose -format png $file;

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

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.

Einen Kommentar schreiben

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.