Categories:


- System -

- Internet -

- Video -

- Audio -

- Pictures -

- Other -


HOW TO install Ubuntu - complete guide

List of everyday used applications (in process)








HOW TO resize whole folder of pictures in a few seconds



So, you want to resize a folder full of pictures but don't have neither time or will to do it picture by picture with your favorite picture editing program. There is a simpler way. Much simpler way. So simple you will not believe. :) OK let's start. First you will need imagemagick program. Open terminal and type:

sudo apt-get install imagemagick

Install it and then navigate to the folder where the pictures you wish to resize are located. Type:

mkdir resized

This will create subfolder called resized in that directory. This is where your resized pictures will be located. Now type:

find . -name "*.jpg" | xargs -i convert -scale 50% {} ./resized/{}

Wait for a while until program finishes and thats it. Now take a look what have you done:


find . -name "*.jpg" - finds all files in working directory that end with '.jpg', in other words, this part of command finds all pictures

| xargs -i - for each line of output (each file/picture found) execute command that follows

convert - name of the program

-scale 50% - resizes vertical and horizontal number of pixels to one half (keeps ratio and shrinks picture to approximately one quarter of its original size)

{} - input pictures, it tells program to convert all pictures that were find by find command

./resized/{} - tells program to save the resized pictures to folder resized which is located in working folder (thats why there is dot in front), pictures will have the same name because the {} is replaced by the output of find command

Thats all. Your resized images are located in folder resized.




You can leave a comment at the homepage.



SEARCH



  • Ubuntu official

  • Ubuntuguide, helps you start using Ubuntu

  • Order latest Ubuntu cd at your doorstep, for FREE


  • If you have problems installing programs with 'apt-get' or 'aptitude' be sure you have enabled universe repositories.
    Click here to see how to enable them.