On Sat, 2 Apr 2005, Richard C. Steffens wrote:
> Is there a set of instructions for automating the task of scaling
> images?

> > line 14: `$img': not a valid identifier
> >
> > for $img in *.jpg

Steve Stavropoulos wrote:
>  That's a simple syntax error. You should write: for img in *jpg
>
> > > convert -size 400x267 -resize 400x267 $img $bigpix/$img_big.jpg
>
>  Another "error" in this script is that the resulting file name would be
> some-file.jpg_big.jpg. Instead of it you could use `basename $img
> .jpg`_big.jpg as I' ve done in the script I gave to you. try basename
> some_file.jpg .jpg to see what this does.

I went back and copied the script you originally wrote for me and gave it a 
try. With some changes to the filename details, it works fine.

Here's the working script. I created the directories outside the script, and 
just do the conversions from within it.

--------------------------------------------
#!/bin/bash
for i in *jpg; 
do
convert -size 25x17 -resize 25x17 $i 25/`basename $i .jpg`-25x19.jpg;
convert -size 100x67 -resize 100x67-size $i 100/`basename $i .jpg`-100x75.jpg;
convert -size 400x267 -resize 400x267 $i 400/`basename $i .jpg`-400x300.jpg;
done
--------------------------------------------

The naming conventions are a poor design choice, which I will resolve the next 
time I revise the site. In the meantime, this works, and I thank you both for 
your help in saving me several hours work each time I want to put a bunch of 
new photos up on the site.


-- 
Regards,

Dick Steffens

_______________________________________________
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user

Reply via email to