Creating thumbnails with the same name as the pictures

Posted by Duby on Ask Ubuntu See other posts from Ask Ubuntu or by Duby
Published on 2012-11-28T01:15:07Z Indexed on 2012/11/28 5:27 UTC
Read the original article Hit count: 179

Filed under:

Please, here is my little code for creating thumbnails of pictures saved in a folder named 'pictures', and saving them in another folder named 'thumbs'.

! /bin/bash

for i in *.jpg do convert -thumbnail 100 pictures/$i thumbs/$i done

However, there two things the program doesn't do:

1) It does not retain the name of the pictures in the thumbnail. For instance, I would want it to generate a thumbnail with the name pic.jpg for a picture named pic.jpg

2) Also, when I run the program, i don't want it to generate the thumbnail for a picture it has already generated its thumbnail, unless that picture has been modified.

Any help will be very much appreciated.

Thank you

© Ask Ubuntu or respective owner

Related posts about thumbnails