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).
- Execute python setup.py install
- Copy the themes in your prefered directory
- 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 :
- save_dir: Full path name where you want to put all the files that mg2-2 will generate. This should generally the the path of your web server.
- html_thumbnailfile : name of the html page for each folder.
- start_path: directory where reside your pictures tree.
- template: name of the template to use.
- resized_dir: name of the sub_directory where the resized pictures will be stored.
- sort_criteria: (name or date) You can order the image by name or by date
- sort_order: (asc or des) the list will be ascendant or descendant.
- ti_background_color: [(0,0,0)] Background color of the thumbnail in the selected template.
- ti_image_size: [800,600] Resized image to fit browser page
- ti_thumb_size: [133,100] Thumbnail size image.
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 ;-).
- link_to_raw: [yes/no] to build a link from image page to the raw image
- i_max_cols_on_thumbs: [4] number of colums on the thumb page
- disp_thumb_date: [no] Display date of the original picture on the thumb page
- disp_thumb_size: [no] Display the date of the original picture on the thumb page
- disp_thumb_size: [no] Display the size of the original picture on the thumb page
- disp_thumb_name: [no] Display the file name of the original picture on the thumb page
- date_format: [%d/%m/%Y] Format of the date ;-)
- theme_link: Full path name to the selected theme's directory. This parameter can be different if you build a stand alone site (c:/mythemes/tv.theme) or if you build a web site (/themes/tv.theme)
- theme_dir: Full path name to the selected theme's directory. In case of stand alone site, this parameter is equal to theme_link.
- bgcolor: [] Background color of each page generatyed
- header: Header of the Thumb page
- page_top_comments: Comments that you can put before the thumbnails.
- page_bot_comments: Comments that you can puts after the thumbnails.
- l_thumbs_sort: list of filenames (separated by a comma) for specific thumbnails order.
- l_folders_sort: List of folders (separated by a comma) for specific folders order.
Samples
You can already find one site using mg22 :
here