Help on creating a HTML by python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sepgy

    Help on creating a HTML by python

    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
  • Gert-Jan den Besten

    #2
    Re: Help on creating a HTML by python

    sepgy writes:[color=blue]
    > 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[/color]


    Your script is meant to create something like this?


    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 "ImageMagic k". Using PIL
    gives it a better performance.

    There is another option:

    This is an Open Source application, built using Python. If you can get
    the source, this may be your best choice.

    Gert-Jan

    --
    Homepage:

    Comment

    • M.E.Farmer

      #3
      Re: Help on creating a HTML by python

      evil_pizz@hotma il.com (sepgy) wrote in message[color=blue]
      > 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.[/color]

      Hello,
      You want to look at this:

      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':

      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 ;)[color=blue]
      > Thanks[/color]
      your welcome ...
      HTH,
      M.E.Farmer

      Comment

      • Jarek Zgoda

        #4
        Re: Help on creating a HTML by python

        sepgy wrote:
        [color=blue]
        > 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.[/color]

        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.s...template.html), as it
        is simple and compact.

        --
        Jarek Zgoda
        http://jpa.berlios.de/ | http://www.zgodowie.org/

        Comment

        • David Fraser

          #5
          Re: Help on creating a HTML by python

          sepgy wrote:[color=blue]
          > 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.[/color]

          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

          Comment

          Working...