On 04/28/2015 06:42 PM, Bob Proulx wrote:
Steve Greig wrote:
I have about 60 large jpg files in a directory. They are almost all over
2MB in size. I want to put them on the internet but wanted to make a
thumbnail version and a small version (about 75KB) of each one so the web
page does not take too long to load.
+1 Bob's answer. Also you can speedup the process by using xargs or
parallel tool.
So if you have 4 cores on your machine you can do the job much faster:
for k in *.jpg ; do echo $k ; done |xargs -I{} -P4 convert -quality
95 {} -geometry 1280 /tmp/{|}||
||
or
|| find /adir_with_pngs -name "*.png" | parallel -P4 convert -quality
95 {} -geometry 1280 /tmp/{.}.jpg|
The last one will also convert png to jpg and substitute the extensions
on the fly.
The result files will end up in /tmp/.