Posts Tagged ‘thumbnail

26
Mar
09

Python thumbnail generator

This is the second version of my first Python program. You know the problem, you got a blog, a website, want to send an email or chat with a lot of photo’s, but nowadays camera’s shoot photos of at least 3 Mega Pixel, if not 10 or more. That is going to take forever to send/receive, if at all posible.(most web server have an upload limit of 5MB)

That is why I made this script, it takes all the jpg files in on(or even more) directories and copies a thumbnail over to another directory. The default is to take all the jpg files in ‘.'(current directory) and copy them with a maximum size of 500×500 to ‘./thumbnails’. Want something else? you can specify the maximum with and height, as much source directories as you want and one destination.

The usage is:

python thumbnailer.py -w 300 -h 200 /some/photo/dir /another/vacation/photo/dir /the/destination/directory/for/thumbnails

The first version had a very bad coding style, but here is the new version:
note: It does not yet work without source and target dir, but I’m working on that fixed it!
another note: You’ll need PIL

[edit]
I’m now on box.net, so here’s the link: http://www.box.net/shared/xptfbsyh84

Advertisements



My blog has moved!

My blog has permanently moved to a self hosted Wordpress at http://pepijndevos.nl

This blog will stay around for accidental search engine visitors.

Me

This is me

Blog Stats

  • 22,629 hits

@PepijnDeVos