You are not logged in.

#1 2010-10-21 15:39:21

whaevr
Member
Registered: 2008-03-17
Posts: 182

Output file have the same name as input

Ive got a bunch of .dds files that i need to resize by about 50%, fantastic thing is the all have relatively long names and are all case sensitive.

Is it possible to use imagemagick to take all the .dds files I have in a directory resize them by 50% and then write the output to a jpg file with the exact same name?

convert -resize 50% *.dds

Only thing Im stuck on is the output

Offline

#2 2010-10-21 15:46:19

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: Output file have the same name as input

You could probably do something like this, or something a bit 'smarter':

for i in $(ls *.dds); do
  convert -resize 50% $i $i
done

Offline

#3 2010-10-21 16:05:12

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: Output file have the same name as input

You could also use mogrify which is from the ImageMagick suite too.

mogrify -resize 50% *.dds

Offline

Board footer

Powered by FluxBB