Edgy Penguins - "Linux for Non-Geeks" - Apps & Projects - jigl
jigl
Page 1 of 2
jigl: In Chapter 9 of Linux for Non-Geeks, you worked with a Python script called pyWings. Now you'll have the chance to work with a very cool and useful script written in another programming language, Perl. The script, which I first saw mentioned in the Linux Journal, is called jigl (Jason's Image Gallery). The script creates an html photo gallery (an example of which you can see directly below) from any folder in which you keep .jpg, .gif, or .png images. Oh, and in case you are worried about such things, jigl is easy to install and, despite despite being command driven, very, very, very easy to use. 



Installing jigl:
  • To install jigl, you will need two or three files, depending on what you have installed: ImageMagick, the jigl tarball itself, and the jhead package upon which jigl depnds.
  • The first thing you will want to do is check whether or not you have ImageMagick installed. The easiest way to go about this is to open a Terminal window and type in rpm -q ImageMagick (you needn't be root to do this) and then hit ENTER. If ImageMagick is installed, RPM will tell you what version you have; if it is not installed, RPM will tell you so.
  • If ImageMagick isn't installed, the easiest way to go about things is to download and install it via APT/Synaptic (Chapter 10). Once you've done that, you are ready to continue.
  • Next, go to the jigl project homepage and scroll down to the Download section to get the Linux version of jigl tarball, the link for which is jigl-2.0.1.tar.gz – Version 2.0.1 (If you prefer, you can just right-click on the link here and then select "Save Link Target As..." in the pop-up menu).
  • Once you've done that, scroll up to and click the jhead link on the jigl page. Once there, download the Linux Binary RPM (Red Hat 9) file, which works fine on Fedora. You can just right-click here and select "Save Link Target As..." to get to the file directly from here if you prefer.
  • Install the jhead RPM file first by double-clicking on it and then following the simple procedure you learned in Chapter 8.
  • Now untar the jigl tarball using File Roller by double-clicking on the tarball and following the simple procedures you learned in Chapter 9.
  • Now cd over to the new folder created by the jigl tarball. As of this writing, that would be jigl-2.0.1, so, asssuming your tarball is in your Home folder, just type in cd jigl-2.0.1 and hit ENTER.
  • So far so good. Next you need to open a Terminal window and then become root by typing su followed by a tap on the ENTER key. Then type in your root password, and hit ENTER again.
  • Now that you are root, you can copy the jigl script itself, jigl.pl (the .pl indicates a Perl script), so that it is both in your system's search path and available to all users. To do this type cp jigl.pl /usr/local/bin and then press ENTER.
  • Finally, you need to change the permissions of the file you've just moved (jigl.pl) so that you can actually execute (run) it. Just type chmod a+rx /usr/local/bin/jigl.pl and then hit ENTER.
  • That's all there is to it, so exit root mode by typing exit and then hitting ENTER. Repeat this sequence once more to close the Terminal window.

Using Jigl: Although there is no graphical interface for Jigl, it is surprisingly easy to use. Just open a new Terminal window and cd over to the folder where you keep your images. For example, if you keep your photos in the photos folder I asked you to create in Chapter 5, then you would type cd photos/ followed by a tap on the ENTER key. After that, all you have to do is type in jigl.pl and press ENTER. The magic will then begin.

The progress of this “magic” will be shown in the Terminal window (see following image). First, jigl will examine what options you've selected (more on that later), and then it will inspect the contents of the target folder (photos/xmas2003b/ in the example) to see if all is hunky dory. Once jigl has decided that it can deal with what you've thrown at it, it begins its work. First it gathers all the information that your digital camera stores with each photo it takes (Exif files). Then it creates thumbnail images for each of the images in the target folder and a folder in which to place them (thumbs). These are used for the gallery index page. Next, jigl goes on to create slides of each image (these are the images that will be actually be shown in the individual image pages) and a folder (slides) in which to place these as well.



Finally, jigl creates the html pages: one slide page for each image, one info page for each image, and one index page (gallery) for the whole shebang. These are placed in a folder, called web, that jigl creates specially for this purpose.


Navigate
Go on to Page 2
Apps & Projects Main
Linux for Non-Geeks Main Edgy Penguins Main Download Project as PDF*

*To download this project as a PDF file, right-click on the Download Project as PDF link above,
and then select "Save Link Target As..." in the pop-up menu.