bug-parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU Parallel Bug Reports Alpha release of GNU Parallel 20110505


From: Hans Schou
Subject: Re: GNU Parallel Bug Reports Alpha release of GNU Parallel 20110505
Date: Fri, 6 May 2011 12:06:06 +0200

2011/5/5 Ole Tange <address@hidden>:

Are you making a video? Then I would start like...

As example I will use the image manipulation program 'convert' from
the ImageMagick package.
A simple way of converting a file from .png to .jpg looks like:
  convert foo.png foo.jpg

With a for-loop do like this:

time \
for file in *.png; do
  convert $file ${file%.png}.jpg
done

With GNU Parallel it is:
time parallel convert {} {.}.jpg ::: *.png

...and then continue with more parameters.

> This
> will convert foo.png to jpg with a size of 800 and JPEG-quality of 95.
>
> convert -size 800 -quality 95 foo.png foo_800_q95.jpg
>
> With a for-loop it can be done on a list of files:
>
> time \
> for file in *.png ; do
>  convert -size 800 -quality 95 $file ${file##.JPG}_800_q95.jpg

The above does not work. Delete from the end is:
  ${file%.png}
or
  ${file%.*}
to delete from the last '.' to the end.

I'll look at the rest later.


/hans



reply via email to

[Prev in Thread] Current Thread [Next in Thread]