RSS/Atom feed Twitter
Site is read-only, email is disabled

Resolved: Automating scaling tasks

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

1 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Pine.LNX.4.44.0504031633230... 07 Oct 20:17
  Resolved: Automating scaling tasks Richard C. Steffens 06 Apr 01:20
Richard C. Steffens
2005-04-06 01:20:52 UTC (about 19 years ago)

Resolved: Automating scaling tasks

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.