Kevin Beason's Homepage > Software > makegallery

makegallery

By Kevin Beason

What is makegallery?

makegallery is a Perl script that will create a webpage gallery of a given set of images. It requires Perl (already installed on many UNIX machines) and the convert command line utility by ImageMagick.

Here is an example gallery created by this script.

Download

More information

Here is the included README file:


makegallery
Kevin Beason
http://www.csit.fsu.edu/~beason/makegallery/
4/16/04


OVERVIEW

makegallery is a Perl script that will create a webpage
gallery of a given set of images (JPEGS).

makegallery can automatically resize large images
by using the "-r xDim yDim" command line option.


SYNOPSIS

make.pl [ -t title ] [ -l list_filename ]
        [ -x cols ] [ -y rows ] [ -r xDim yDim ] file1 file2 ...

  -t title      Title to use for gallery.
  -l filename   File containing list of images to use.
  -x cols       Columns to use in thumbnail gallery.
  -y rows       Rows to use in thumbnail gallery.
  -r xDim yDim  Display photos using (xDim,yDim) resolution,
                by using resizing.


INSTALLATION

Copy the included .gif images into a web accessible
folder. Edit makegallery.pl and set the $imagesurl
variable to point to the URL of the directory you chose.

For example, if your homepage is: http://something.com/~user,
you can copy the images into an images directory in your
public_html directory, and then you edit makegallery.pl
so that the $imagesurl variable looks like this:

my $imagesurl = "http://something.com/~user/images";

Next, if you want to use makegallery without having to type
the full path, place makegallery.pl into a directory in your PATH
environment variable.


USAGE

Place your images in a web accessible directory.
cd into that directory, and then run
makegallery.pl passing the list of files you want
to show as options on the command line.

For example, lets say you have a collection of 
large photographs from a vacation that you want
to show. This command will resize the images
and create a thumbnail gallery linking to the
resized images:
  
  ~/makegallery-1.0/makegallery.pl -r 800 800 *.JPG


MISCELLANEOUS

If after creating the gallery you would like to password
protect it, do the following. These instructions assume
you are using the apache webserver.

Create the password file by running this Perl command:

  perl -e 'print "username:", crypt("password","sc"), "\n"' > .htpasswd
  
Place this file is in your images directory. Cut and paste the
following into a file called .htaccess in the same directory as
your images, being sure to replace "/path/to/your/images" with
the full path of the directory containing your images and this file.
  
=============================
AuthType Basic
AuthUserFile /path/to/your/images/.htpasswd
AuthName "my_pictures"
require valid-user
=============================

Make sure both files are world readable:

  chmod 644 .htaccess .htpasswd
  
That should be it.

Have fun.

Kevin Beason
4/16/04

Kevin Beason / kevin.beason [] gmail.com Home