hello dear guy <br><br>many thanks for the great explanation.<br><br>you helped me alot and you deserve a monster congratulation-<br><br><br>greetings<br><br>matze<br><br><div class="gmail_quote">On Mon, Apr 9, 2012 at 2:10 AM, Guy Stalnaker <span dir="ltr"><<a href="mailto:jimmyg521@gmail.com">jimmyg521@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You should still be able to use his script with one slight modification. So you can do this two ways. Though I use the zsh shell which is quite similar, you likely use the bash shell, which is the default for nearly every Linux distribution.<br>
<br>
<br>
Way #1:<div class="im"><br>
<br>
for I in *.jpg ; do<br></div>
convert -resize 800x600 $I ${I%.jpg}_resized.jpg ;<br>
echo -n "." ;<br>
done<br>
<br>
Way #2<br>
<br>
for I in *.jpg ; do convert ${I} ${I%.jpg}_resized.jpg ; done<br>
<br>
I usually do this on a single line which is why I showed the second one :-)<br>
<br>
Note the change. The second $I becomes ${I%.jpg}_resized.jpg -- the %.jpg is the part that tells bash that the part of the filename that follows the % should be removed and then what follows the } will be added. Thus the .jpg in the first filename becomes _resized.jpg in the second one:<br>
<br>
DSCN_20120310T193618.jpg<br>
DSCN_20120310T193618_resized.<u></u>jpg<br>
<br>
I tested this and it works. Note how useful this is :-) You can convert from one type of file to another:<br>
<br>
${I%.tif}.jpg<br>
<br>
Do bulk convert modifications for resizing, gamma correction, saturation mods to a group of files. The nice thing here is that you get to keep the first set of files unmodified if you add the }_modified.ext for each pass. It's usually good to keep the original unmodified files in case something goes awry. And things will go awry.<br>
<br>
Hope this helps.<br>
<br>
In case you wonder, for the zsh shell the command to resize is:<br>
<br>
for i in *.jpg ; do convert -resize 800x600 ${i} ${i:s/.jpg/_resized.jpg/} ; done<br>
<br>
This follows very closely conventions in the vi(m) editor where s/x/y/ is the search/replace command: s/what_to_find/change_what_to_<u></u>this/<br>
<br>
Guy<div class="im"><br>
<br>
On 04/08/2012 06:28 PM, Martin Kaspar wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
hello dear list, hello dear Remco<br>
<br>
many thanks for the quick reply.<br>
<br>
i had a quick look at the machine - i have the necessary libraries to<br>
performe the little script you suggested .<br>
<br>
ssee here the preliminary - i have the following preliminary things on<br>
my machine.<br>
<br>
martin@linux-wyee:~> rpm -qf $(which convert)<br>
ImageMagick-6.7.2.7-5.1.3.i586<br>
martin@linux-wyee:~><br>
<br>
<br>
but this script does not run - as target and sourcde are the same.<br>
<br>
<br>
for I in *.jpg ; do<br>
convert -resize 800x600 $I $I ;<br>
echo -n "." ;<br>
<br>
<br>
well - if all the files are in one folder - how should i re-design the<br>
script.<br>
there have to be different names - ohterwise convert or bash will be<br>
complaining..<br>
<br>
can you help out here -<br>
note: all the files are in the same folder<br>
<br>
<br>
look forward to hear from you<br>
<br>
greetings<br>
matze<br>
<br>
<br>
<br>
On Sun, Apr 8, 2012 at 2:09 PM, Remco Viëtor <<a href="mailto:remco.vietor@wanadoo.fr" target="_blank">remco.vietor@wanadoo.fr</a><br></div><div class="im">
<mailto:<a href="mailto:remco.vietor@wanadoo.fr" target="_blank">remco.vietor@wanadoo.<u></u>fr</a>>> wrote:<br>
<br>
On Sunday 08 April 2012 12:46:33 jdd wrote:<br>
> Le 08/04/2012 13:04, Martin Kaspar a écrit :<br>
><br>
> > i have a bunch of photos that i want to show in a image slider on<br>
> > the Web.<br>
<br>
> or better, use a scrit like mine:<br>
><br>
> for I in *.jpg ; do<br>
> convert -resize 800x600 $I $I ;<br>
> echo -n "." ;<br>
><br>
> done<br>
<br>
Just be aware that that script, as written, overwrites the original<br>
file,<br>
which might not be what you want<br>
<br>
Remco<br>
______________________________<u></u>_________________<br>
Digikam-users mailing list<br></div>
<a href="mailto:Digikam-users@kde.org" target="_blank">Digikam-users@kde.org</a> <mailto:<a href="mailto:Digikam-users@kde.org" target="_blank">Digikam-users@kde.org</a>><br>
<a href="https://mail.kde.org/mailman/listinfo/digikam-users" target="_blank">https://mail.kde.org/mailman/<u></u>listinfo/digikam-users</a><div class="im"><br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Digikam-users mailing list<br>
<a href="mailto:Digikam-users@kde.org" target="_blank">Digikam-users@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/digikam-users" target="_blank">https://mail.kde.org/mailman/<u></u>listinfo/digikam-users</a><br>
</div></blockquote><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
"There is only love, and then oblivion. Love is all we have<br>
to set against hatred." (paraphrased) Ian McEwan<br>
<br>
Guy Stalnaker<br>
<a href="mailto:jimmyg521@gmail.com" target="_blank">jimmyg521@gmail.com</a></font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
Digikam-users mailing list<br>
<a href="mailto:Digikam-users@kde.org" target="_blank">Digikam-users@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/digikam-users" target="_blank">https://mail.kde.org/mailman/<u></u>listinfo/digikam-users</a><br>
</div></div></blockquote></div><br>