How to resize multiple image with single command

I tend to be lazy .. hehehehe..

sometime I took a lot of picture then later don’t know how to select and post ..
some more need to resize each one of them before publish or send out to somebody else..

figured out.. by creating a simple bash script file with following content :

~/bin/resize_my_images.sh

for i in `ls  *.JPG`
do
convert -verbose -resize 50% -comment "(c) HawkEYE Expression's" $i resized_${i%%.*}.jpg
done

* Updated to fix the filename extension to lower-cased..

Then have make it executable .. before can use .. by issuing this command.

chmod a+x  ~/bin/resize_my_images.sh

to use it..

cd ~/where/to/image_folder/
~/bin/resize_my_images.sh .

it will take every single JPG file in the folder and resized it by 50% .. and renamed to resized_original_name.jpg
quite handy when to handle let’s say 300+ images…

p/s : can remove verbose string if don’t want to know the progress of the conversion process..
btw .. dependencies is :

[root@nb-namran ~]# rpm -q --whatprovides /usr/bin/convert
ImageMagick-6.2.8.0-4.el5_1.1

Related Post

3 Responses

  1. Uncle Foobar says:

    Hey! Thanks for this! Great walkthrough.

    I just downloaded and played with this myself
    for the first time, and i enjoy getting directions
    for stuff to look at.

    Another alternative to the two part USB files:
    in the readthisfirst file, there is a list of mirrors
    to the ISO worldwide.

    Also: i did the wget app download (you might
    want to “blank out” the first failed attempt)

    Question: where is the “app store” for
    Android stuff? is it an app? is it like Cydia
    for jailbroke iphones?

    I want to walk around in the softs a bit.

    thanks!

    Foob

    Reply ↓
    • namran says:

      Uncle Foobar : ok.. had ‘blank out’ the first failed attempt on the app installation due to typo error of the app url..

      App store for Google Android is available at http://www.android.com/market/

      however.. it may not available at your mobile due to some TELCO / countries restriction..
      please check the local Android user community..
      or just go to http://developer.android.com/community/

      😎

      Reply ↓
  2. ahstod says:

    App Store is not open-sourced, hence not in these kind of builds. You need to have some agreement with google to distribute it on your “phones”.

    You can browse what’s available in the market through the following hack http://www.cyrket.com from the same guy who brought you cydia on the iphone.

    Having said that … those who have rooted android phones … can probably download an app from the market and “share” it with you …

    Reply ↓

Leave a Reply

Your email address will not be published. Required fields are marked *