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

2010-04-12 166 words 1 min read

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.


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it