mg2

Introduction

mg22 is a python application that allows you to build a complete web site in only ONE command.  Just select the directory where your pictures resides and the template you want to have by editing the mg2-2.ini (check "config file" here under).
More simple, it's difficult.

Despite such simplicity, mg22 have lot of functionalities : adding comments, adding dates, resize thumbs, sort by name, sort by creation date, ...

As from mg22-1.1, you can now extract any kind of EXIF data available from your picture.

Here an example of data you can extract from:
EXIF ColorSpace (Short): 1
EXIF ComponentsConfiguration (Undefined): YCbCr
EXIF CompressedBitsPerPixel (Ratio): 2
EXIF DateTimeDigitized (ASCII): 2003:12:22 09:09:33
EXIF DateTimeOriginal (ASCII): 2003:12:22 09:09:33
EXIF ExifImageLength (Long): 864
EXIF ExifImageWidth (Long): 1152
EXIF ExifVersion (Undefined): 0220
EXIF ExposureBiasValue (Signed Ratio): 0
EXIF ExposureProgram (Short): Program Normal
EXIF ExposureTime (Ratio): 1/50
EXIF FNumber (Ratio): 9/5
EXIF FileSource (Undefined): Digital Camera
EXIF Flash (Short): Not Available
EXIF FlashPixVersion (Undefined): 0100
EXIF FocalLength (Ratio): 38/5
EXIF InteroperabilityOffset (Long): 572
EXIF LightSource (Short): Unknown
EXIF MaxApertureValue (Ratio): 17/10
EXIF MeteringMode (Short): 5L
EXIF SceneType (Undefined): Directly Photographed
EXIF Tag 0xA401 (Short): 0
EXIF Tag 0xA402 (Short): 0
EXIF Tag 0xA403 (Short): 0
EXIF Tag 0xA406 (Short): 0
Image DateTime (ASCII): 2003:12:22 09:09:33
Image ExifOffset (Long): 176
Image Make (ASCII): SONY
Image Model (ASCII): DCR-TRV33E
Image Orientation (Short): 1
Image ResolutionUnit (Short): Pixels/Inch
Image XResolution (Ratio): 72
Image YCbCrPositioning (Short): 2
Image YResolution (Ratio): 72
Thumbnail Compression (Short): JPEG Compressed
Thumbnail DateTime (ASCII): 2003:12:22 09:09:33
Thumbnail JPEGInterchangeFormat (Long): 797
Thumbnail JPEGInterchangeFormatLength (Long): 5834
Thumbnail Make (ASCII): SONY
Thumbnail Model (ASCII): DCR-TRV33E
Thumbnail Orientation (Short): 1
Thumbnail ResolutionUnit (Short): Pixels/Inch
Thumbnail XResolution (Ratio): 72
Thumbnail YCbCrPositioning (Short): 2
Thumbnail YResolution (Ratio): 72
File has JPEG thumbnail
mg22 is a total rewrite (from scratch) of mg2.
Sorry for that, but there is no backward compatibilities between mg22 and mg2. But fonctionalities of mg2 are present in mg22.

Installation

mg22-1.1 requires Python 2.3 (usage of the new datetime module) or higher and PIL (Python Image Library).
  1. Execute python setup.py install
  2. Copy the themes in your prefered directory
  3. Copy mg22-generate in your prefered directory (must be in "path")

Download mg22-1.1
older version are still available here


mg22 was tested on Windows machines and on Linux machines, but should work where python and PIL runs.

Command-line arguments

Few number of arguments differs from the original mt2.

Usage: mg22-generate [options]
  Options:
   -h or --help  show this message
   -c|--config <config file> (mg2-2.ini)
   -f|--force

Config file

The generic config file allows you to define global parameters for the whole process : All the other parameters are template dependent, but will be exactly considered the previous one. They are known as "themeconf", check template Readme for details.

Plugins

ThemeThumb template

Currently a tempalte compatible to cthumb has been written.
Themes available for cthumb-4.2 has been added in the mg22 tar file.
This theme overwrite the "generic config" parameter ti_thumb_size to the best value depending of the images in the theme.

Config file

The following parameters can be specified as default value in mg2-2.ini.
But, you will be able to adapt them in each folders as you want.
You will be able to have different themes or colors, ... for each folder, ... you see the flexibility ;-).

Samples

You can already find one site using mg22 : here