You are not logged in.

#1 2009-04-05 19:27:29

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818

imagemagick batch resize with spaces in filenames [SOLVED]

hello there, I've got plenty of photos to resize. I'm trying to use imagemagick's mogrify for recursive batch resizing, but I've got many folder with spaces in their names, so that doesn't work.
The command I found on the internet is the following:

$ find somefolder/ -name "*.jpg" -exec mogrify -resize 1024x768 {} \;

Is there any way to escape spaces in file path?

thx

Last edited by brazzmonkey (2009-04-06 21:00:38)


what goes up must come down

Offline

#2 2009-04-05 19:32:48

peart
Member
From: Kanuckistan
Registered: 2003-07-28
Posts: 510

Re: imagemagick batch resize with spaces in filenames [SOLVED]

What happens if you put the {} in quotes? --> "{}"

Offline

#3 2009-04-05 19:38:44

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,896
Website

Re: imagemagick batch resize with spaces in filenames [SOLVED]


Mr Green

Offline

#4 2009-04-05 20:12:48

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818

Re: imagemagick batch resize with spaces in filenames [SOLVED]

@peart: I thought about this one myself. Doesn't work.

@Mr Green: does this mean I'm supposed to have something like that:

$ find somefolder/ -name "*.jpg" -exec mogrify -resize 1024x768 {//\ /\\ } \;

*edit*
no, definetely no. I guess I misunderstand.

Last edited by brazzmonkey (2009-04-05 21:48:44)


what goes up must come down

Offline

#5 2009-04-06 08:30:36

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818

Re: imagemagick batch resize with spaces in filenames [SOLVED]

$ find somefolder/ -name "*.jpg" -ls -exec mogrify -resize 1024x768 {} \;

doesn't work either.

Last edited by brazzmonkey (2009-04-06 21:00:09)


what goes up must come down

Offline

#6 2009-04-06 20:59:41

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818

Re: imagemagick batch resize with spaces in filenames [SOLVED]

alright, I finally got over it using jhead:

jhead -cmd "mogrify -resize 1024x768 -quality 80 &i" -r *.jpg

what goes up must come down

Offline

Board footer

Powered by FluxBB