Generate web thumbnails page (gallery) for free with convert command on linux

2010-04-12 1 min read Linux Photo

Here&#8217;s something for guys who want to generate html file with thumbnails of photos. I know sometimes it really gets messy. So sometime back I had found a search on the net for the same and found a script written by Samuel Hocevar.  Sorry I do not seem to have the link to the page, but since the script is GPL and name of the author is there in the script, I can put it for download from my web-blog also. So here is the script <a href="http://amit-agarwal.co.in/wordpress/wp-content/uploads/2009/01/genthumb.sh">genthumb

The script will convert the images to thumbnails using the convert command and then create index.html linking all the created thumbnails into the page one by one. The logic as used by the program is as below:

For each jpeg found in the directory or the subdirectory, it will execute:

convert -geometry ${THWIDTH}x${THHEIGHT} &#8221;$file&#8221; &#8221;$newfile&#8221; >/dev/null 2>&1

to create the thumbnail. Then it will create the info file which it uses to create the links. Simple and elegnant.

comments powered by Disqus