Copyright (c) 2000-2005, Daniel M. Lowe
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
The name of Daniel M. Lowe may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Mig requires a web server which supports PHP [ http://www.php.net/ ]. At least PHP 3.0.6 is required, or any version of PHP4. The development platform is Apple OSX, so the code tends to assume a unix-like environment. As such it may or may not work (and has not been tested by the author) on non-unix-like platforms. Mig has been tested with Apache (and reportedly it works with Microsoft's IIS server).
Windows users, please see the section labeled "Running Mig Under Windows" below.
The mkGallery.pl utility requires Perl [ http://www.perl.com ]. To generate thumbnail images, it also requires ImageMagick [ http://www.imagemagick.org/ ]. Neither are required to use Mig itself.
The jhead utility which is called by mkGallery.pl for EXIF header parsing is a C source code file - it must be compiled before use. On most unix-like systems this is as easy as going into the jhead directory and typing "make" (GNU make is recommended).
Windows users can download the pre-built jhead program from Mathias Wandel's site at http://www.sentex.net/~mwandel/jhead/
See the "utilities" document for more information about mkGallery.pl and jhead.
If you are using one of the following Portal / Content Management systems, make sure to read the portals document.
PHP-Nuke PostNuke PHPWebSite PHPWebThings Xoops Geeklog
Read this section if you are installing Mig for the first time. If you are upgrading, skip to the next section which deals with upgrading.
People Family Friends The_Zoo Dolphins Bears Lions Cars
Notice that I used an underline character in The_Zoo. Mig will display that as a space, so the album will be called The Zoo as far as visitors will know. This makes things simpler since some systems make using underlines in directory names unfriendly.
The above example ends up being these eight gallery folders:
People People : Family People : Friends The Zoo The Zoo : Dolphins The Zoo : Bears The Zoo : Lions Cars
Mig supports JPEG, GIF and PNG images. So files with any of these extensions will be recognized as images:
.gif .png .jpg .jpe .jpeg
Files with these extensions are recognized as audio:
.mp3 .wav .ra .ram
File with these extensions are recognized as video:
.mov .avi .mpg .mpeg .wmv .mp4Point your web browser to the newly-installed Mig and browse away! If you can run Perl scripts on the commandline on your server, and you have Perl and ImageMagick available, use mkGallery.pl to create thumbnail images. See the utilities document for more information on how.
You should create a utilities subdirectory in your Mig installation and copy mkGallery.pl there, as well as jhead if you plan to use jhead. If Perl is somewhere other than /usr/bin/perl on your system you may need to modify the first line of mkGallery.pl to reflect the proper location of Perl.
If you can't run Perl scripts, you can make your own thumbnail images in whatever way is handy for you (an image editing program, for example). In each album folder, create a subdirectory called thumbs, and put thumbnail images inside. A thumbnail should have the same filename as the full-size image it represents.
The thumbnail subdirectory is thumbs by default, but this can be
customized (see the $thumbSubdir
option in config.php).
If you are upgrading from a previous version of Mig, follow these steps:
If you want mkGallery.pl to be able to use jhead, put jhead in the utilities subdirectory of your Mig installation with mkGallery.pl.
If you already have jhead, check the changelog document to see if it's been upgraded since you last installed it. You may want to install a fresh version over your old copy.
If you are upgrading to 1.4.0 from an earlier version, you should copy the movie.gif and music.gif icons from the images folder to your Mig installation's images folder, if you plan to have any audio or video content on your site.
Mig can run under Windows (so I'm told) as long as the web server supports PHP. The Windows version of PHP is available from http://www.php.net/
Mig is reported to work with IIS, Personal Web Server, and the Windows port of Apache. One user noted that a fairly recent version of PHP is needed for it to work, so if you're having trouble, make sure you're using the most recent release of PHP.
Another user reported that having a comma (,) in the directory name of any album would cause problems, so avoid using commas.
I've had reports that Windows text editors leave files without trailing end of line characters, which apparently confuses Mig. If you're editing files in a Windows text editor (such as mig.cf files), you may want to leave one blank line at the end of the file, just so there's at least one end of line character after the last "real" line.
If you want to see an example gallery (that is, install one on your system and examine the files that it contains), you can download one from the Mig project page at http://sf.net/projects/mig/ (look in the "Extras" section in the project files listing). After downloading the file, unpack it in the albums sub directory and it should appear as "Mig Example Gallery".
You can see a list of sites using Mig at: http://mig.sf.net/users.php
If you'd like to list your site there, email me: at dan@tangledhelix.com
Mig is free. But I don't object to getting postcards if you feel like telling me how much you like Mig. Postcards can be sent to:
Dan Lowe P.O. Box 5725 Cleveland, OH 44095 USA
A per-folder custom template can be used in any given folder. See the
FolderTemplate
section of the mig_cf document for more information.
Comments are shown in a box below the image in image views. In
thumbnail views, they are shown as the ALT tag text. (That behavior can
be suppressed by setting $suppressAltTags
to TRUE
in config.php).
As an example, let's say you have files house.jpg, car.gif and dog.jpg. Let's say you wanted a comment on the house and the dog, but nothing in particular to say about the car. Add this to mig.cf:
<Comment "house.jpg"> This is my house, which I bought in the fall of 1998. </Comment>
<Comment "dog.jpg"> This is the dog we had when I was growing up. She was a lot of fun! Sadly, she died when I was 12 years old (she had cancer). We had other dogs afterward, but none of them were as much fun. </Comment>
(mkGallery.pl users, see the -c
option which handles comments.)
The description can be multiple lines, as long as it's enclosed inside the <comment>...</comment> structure. Tags such as <comment> must be at the start of a new line.
(If you want to use shorter comments for thumbnail hover-overs and leave your longer comments only on the image page itself, see the mig_cf document and read about <Short> tags).
EXIF data generally contains information such as shutter speed, aperture, ISO rating, the original shooting date and time, and sometimes comments. Mig can read some, but not all, of this data. Future versions of Mig may understand more of the data than it currently does.
By default Mig only shows embedded comments. To show more, adjust the
format string $exifFormatString
found in config.php. There are
examples in that file that explain how the formatting works.
Note that most graphic editors destroy EXIF blocks! They don't know how to write them so when they save images, they are simply not written back into the file.
See config.php.default for more information - Mig now supports English, French, German, Norwegian, Portugese, Finnish, Romanian, Russian (Windows-1251 and KOI8-R), Turkish, Swedish, Danish, Italian, Spanish, Slovak, Dutch, Polish (including an ISO-8859-2 version), Estonian, Japanese (ISO-2022-JP), Traditional Chinese (big5) and Czech.
It's also possible to use multiple languages with Mig, although you must
pick one to be the default language - that is the one you define in
config.php in the $mig_language
variable. To change the language,
simply add the parameter mig_dl=LANG
to a URL as a parameter. For
example, take this URL:
http://mysite.com/gallery/index.php?currDir=./MyStuff
Assuming the default is something else, you can tell Mig to display it in Spanish by doing this:
http://mysite.com/gallery/index.php?currDir=./MyStuff&mig_dl=es
You can add links to your template files which switch languages on the fly
using the template keyword newLang
like this:
<a href="%%newLang%%=es">Espanol</a>
<a href="%%newLang%%=it">Italiano</a>
$imagePopup
option in
config.php).
This can be controlled using two options in config.php:
$maxThumbColumns
and $maxThumbRows
. Their names are
self-explanatory. Set $maxThumbColumns
to the maximum number of columns
desired (how many thumbnails across from left to right in one row). Set
$maxThumbRows
to the maximum number of rows per page/screen. The
defaults are 4 columns and 5 rows (for 20 images per page).
Note that even with pagination, Mig still has to look over the entire directory (to sort it, decide what is on which page, etc) and in really large directories, you'll still run into problems. Mig may take a long time to run, etc. It's best to keep directories down to more reasonable sizes (after all, that's why directories were invented - organization).
$randomFolderThumbs
to TRUE
in config.php.
(See also $folderNameLength
and $useRealRandThumbs
.)
If the folder itself contains only other folders, and no images, Mig will traverse subdirectories until it finds a usable thumbnail to use as an icon. So the only time the generic icon will be used is in a situation where there is a folder that contains no thumbnails, whose subfolders and their subfolders, etc, contain no thumbnails. In other words, only a useless folder branch would result in the generic folder icon being shown.
UseThumb
option in
mig.cf files. See the mig_cf document for more information.
If you can't do it that way, don't despair - you can make your own thumbnails in any image editing program. Earlier in this document are instructions on how to name the files and where to put them.
error_reporting
set too
high in the PHP configuration in your web server. Put this line
near the top of index.php (but not before the "<?php"
line at the top).
error_reporting (E_ALL & ~E_NOTICE); // for PHP3 systems
error_reporting (2039); // for PHP4 systems
-K
flag and see if your images come out
properly then.
To report a bug, or view existing bug reports, go to:
http://sourceforge.net/tracker/?group_id=24365
To request a feature, or view existing feature requests, go to:
http://sourceforge.net/tracker/?group_id=24365
http://lists.sourceforge.net/lists/listinfo/mig-announce
http://lists.sourceforge.net/lists/listinfo/mig-users
http://lists.sourceforge.net/lists/listinfo/mig-devel