Help on creating a HTML by python

S

sepgy

Can anyone help me to use a python to create an HTML photo gallery
generator. When it's finished, it will be able find all the picture
files (i.e. .jpg, .gif. .png files) in any given folder on the
computer, automatically create smaller thumbnails for each image, and
then generate a complete HTML file that displays a clickable image
gallery. When viewed in a web browser, the HTML file will display the
thumbnails in a neatly formatted table, and if you click on one of the
thumbnails the full-size image will appear.

Thanks
 
G

Gert-Jan den Besten

sepgy said:
Can anyone help me to use a python to create an HTML photo gallery
generator. When it's finished, it will be able find all the picture
files (i.e. .jpg, .gif. .png files) in any given folder on the
computer, automatically create smaller thumbnails for each image, and
then generate a complete HTML file that displays a clickable image
gallery. When viewed in a web browser, the HTML file will display the
thumbnails in a neatly formatted table, and if you click on one of the
thumbnails the full-size image will appear.

Thanks


Your script is meant to create something like this?
http://home.hccnet.nl/gj.den.besten/20040822_maasbommel/html/overzicht_01.html

A few months ago I wrote this script to get familiarized with Python. It
has a few disadvantages:
* It is not written in English (in Dutch actually).
* Written using a procedural/modular programming style.
No classes are used, so it is not very "Pythonic"
* Written to meet my needs to get pictures published on my website.
* No GUI.

When I get rid of the first two disadvantages, I will publish the
sourcecodes on my website. It will be GPL'ed.

So far, I tested it on Linux and WinNT and it seems to work fine. It
uses the "Python Imaging Library" instead of "ImageMagick". Using PIL
gives it a better performance.

There is another option:
http://info.linspire.com/lphoto/
This is an Open Source application, built using Python. If you can get
the source, this may be your best choice.

Gert-Jan
 
M

M.E.Farmer

(e-mail address removed) (sepgy) wrote in message
Can anyone help me to use a python to create an HTML photo gallery
generator. When it's finished, it will be able find all the picture
files (i.e. .jpg, .gif. .png files) in any given folder on the
computer, automatically create smaller thumbnails for each image, and
then generate a complete HTML file that displays a clickable image
gallery. When viewed in a web browser, the HTML file will display the
thumbnails in a neatly formatted table, and if you click on one of the
thumbnails the full-size image will appear.

Hello,
You want to look at this:
http://www.uselesspython.com/thumbnail.py
I also did this very thing when i first started learning Python.
Found it quite educational and learned much in the process.
Here was my try at 'improving it':
http://bellsouthpwp.net/m/e/mefjr75/python/Thumbz.py
You can see my dumb newbie code , of course that was two years ago ;)
There are others out there too try thumbnail.py in a Google search sometime ;)
your welcome ...
HTH,
M.E.Farmer
 
J

Jarek Zgoda

sepgy said:
Can anyone help me to use a python to create an HTML photo gallery
generator. When it's finished, it will be able find all the picture
files (i.e. .jpg, .gif. .png files) in any given folder on the
computer, automatically create smaller thumbnails for each image, and
then generate a complete HTML file that displays a clickable image
gallery. When viewed in a web browser, the HTML file will display the
thumbnails in a neatly formatted table, and if you click on one of the
thumbnails the full-size image will appear.

Once I had similar idea -- I planned to use PIL for generating
thumbnails and some templating/transformation library for generating
HTML. It all ended up with HTMLTemplate
(http://freespace.virgin.net/hamish.sanderson/htmltemplate.html), as it
is simple and compact.
 
D

David Fraser

sepgy said:
Can anyone help me to use a python to create an HTML photo gallery
generator. When it's finished, it will be able find all the picture
files (i.e. .jpg, .gif. .png files) in any given folder on the
computer, automatically create smaller thumbnails for each image, and
then generate a complete HTML file that displays a clickable image
gallery. When viewed in a web browser, the HTML file will display the
thumbnails in a neatly formatted table, and if you click on one of the
thumbnails the full-size image will appear.

Note that with the EXIF.py tool you can extract existing thumbnails
stored inside JPEG or TIFF files without generating them yourself, which
is much faster.
Most digital cameras nowadays generate these thumbnails...

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,212
Messages
2,571,101
Members
47,695
Latest member
KayleneBee

Latest Threads

Top