This page was last modified: January 06 2008 23:51:23   
Too Cool for Internet Explorer

MG2 gallery

Posting photos at a website can be a cumbersome task. Every picture must be resized (since modern digital cameras create pictures in very high resolution), uploaded and presented on a webpage - maybe even with a thumbnail for each picture.

So how can we make this task as quick and easy as possible? Here's my solution:

A friend of mine recommended MG2, which is a PHP image gallery script. It's extremely easy to setup and use, and include alle the necessary features. Most importantly, you don't need a database for this to work, and MG2 supports FTP uploads and image EXIF information.

Download and unpack MG2 according to the install instructions at the download page. Then point your browser to it, and follow the wizard to get started. Within the admin interface, create a new folder.

You do not want to upload pictures from your camera unmodified. It takes too long to upload them and your viewers will fall a sleep while waiting for each picture to be displayed.
Use a command line tool like mogrify to give them a web-friendly size:

  • Copy the original pictures to a new folder (very important)
  • Change directory to the new folder
  • Do not concern yourself with image rotating at this point
  • Resize all images in one go (preserving aspect ratio) - examples:

    Resize all jpg images to a max width of 800px
    mogrify -resize 800 *.JPG

    Resize alle jpg images to a max width of 800px and a max height of 600px
    mogrify -resize 800x600 *.JPG

All you need to do now is uploading the images (for example through an ftp client) to the 'pictures' folder at the root of the gallery. Browse into the administration area. Click on the folder where you want the pictures, and click "Import"

Click the 'edit' button of the first picture. Rotate it if necessary, add a title and some descriptive text if you like, and save the changes (press the button titled 'Ok'). Notice that when you press 'Ok' the next picture in the list, automatically appears. This saves you the trouble of finding the next picture and clicking 'Edit', which is a huge timesaver.