Some time I must upload a lot of image to this site, but original size is to big and will take very long time to upload. So I must resize it first to at least 1024x768, but resizing a lot of image using manual or mouse click under GWENVIEW batch conversion tool is take a long time too...so I remember that imagemagic can do this using commandline, so I try it and create a script to make it easier. Below is my script:
------------------------------
#!/bin/bash

for ip in $(ls *.jpg)
do
  echo ------------------------------------------------
  echo "Converting $ip"
  convert -scale $1  "$ip" "./small/$ip"
done
 ------------------------------

that's it, I save it as conv_img and make it as executable.

you can run it under directory with a lot of jpg files with command:

conv_img 20%

then it will create 20% scaled of every image and put it under "small" directory in curent directory.





8 Comments
genialbutuhsomay wrote on May 20, edited on May 20
interesting... but..
how to use it??? there's no need url or something?

iipx wrote on May 20
It is a bash scripting, for working with directory only. Not for a web page, but this can also applied for the web, you have to modify it to fit your need and there are a lot more features from imagemagic that you could use to manipulate image file.
genialbutuhsomay wrote on May 20
what "bash scrpting" means???
heheheh... om.. saya gk ngrti bahasa
komputer... jadi pke bhsa bumi aja yahh...

ini bukan software kan?
iipx wrote on May 20
Hehe bash itu salah satu dos promptnya linux, tapi saya juga udah bikin untuk yang for windows pake batch file...besok deh tak copi-in, sekarang lg gak didepan kompi :)
genialbutuhsomay wrote on May 20
wahhh.. ok deyh...
maaf jadi ganggu krn trnyta lg gk di dpn kompi...

seepp seepp... mksh reply nya yah bang...
salam...
iipx wrote on May 20
Oh ya nanti saya sekalian kasih contoh buat bikin transparent label untuk banyak photo pake imagemagic....gak besok kali yah..besok saya ada project ke luar kota...
genialbutuhsomay wrote on May 20
wowww... tau2 ada project nih...
kcepretan dung...?!?!? heheheh...
iipx wrote on May 20
Huehehe...
Add a Comment
   
© 2008 Multiply, Inc.    About · Blog · Terms · Privacy · Corp Info · Contact Us · Help