Pix, the PHP Image Carousel Photo Album

A PHP script to display your images and photographs

by Tim Hill

Suitable for any OS.
A web server with PHP is required.
No Javascript.

I think there may be a few people like me who want to do something simple: take some photographs or create some images and then put them on the internet or display them locally for your friends and family to see. Perhaps you don't want facebook or instagram to re-process your pictures to be smaller and of a poorer quality with badly cropped thumbnails. If you have some web space into which you can upload your images or a local web server with PHP this is just the script you've been looking for! You can easily create albums similar to Blue-Bike and Schooner Pickle without editing the script at all.

Using the Pix Carousel PHP script is simple: carousel.zip (4.2MB) contains all the files which generate this example. When installed on your web server, what's in the .zip download should produce identical output. All you have to do to display your own pictures is to substitute your own images (in three sizes) and provide caption files (which can be empty). The zip includes the Pix script (pix/pix.php) as well as an essential but minimalist shell 'parent' index.php, and three example images in various sizes and their captions in appropriate directories. Don't point your browser at the script directly, target the index.php in the parent directory which 'includes' the script. As you navigate the images, the index.php reloads itself (and the pix.php script) and whether it displays a sheet of thumbnails or a single larger image with previous/next navigation buttons depends on the parameters the script passes itself. Selecting the larger image results in the original (largest) image being displayed by the browser. Use the back button to return to the larger image and the up arrow to return to the thumbnails.

Here are the instructions on how to start using the Pix Carousel PHP script. Please try them with only a few images at first.

  1. Copy the contents of carousel.zip (4.2MB) to a new web folder.
  2. Type the path to the new folder into your browser.
  3. Make sure the output you see is the same as this example. Test it.
  4. When you know the script works, you may want to remove the original three images: empty EVERY directory inside the folder 'pix'. See how their filenames are similar.
  5. Choose your own original images from your collection having cropped or otherwise tweaked them as necessary. Copy them into the folder 'pix/originals'. They will be displayed in alphabetical sequence so adjust the filenames to change the order in which your pictures are shown.
  6. From your originals create 95% jpeg images constrained to 800 by 800 pixels (retain the aspect ratio and file name). Take care not to overwrite the originals! Save the new files to the folder 'pix/800x800'.
  7. From the 800x800 files create 95% jpeg images constrained to 240 by 240 pixels (retain the aspect ratio and file name). Save the new files to the folder 'pix/240x240'.
  8. Pix

    Promote your Page too
  9. Inside 'captions' you need to create a text file for each original image. Ideally, an image called <filename>.jpg in the three image directories will have a corresponding caption file called <filename>.txt.
  10. Edit the files in 'captions' as required or leave them empty. The captions are inserted into ALT and TITLE tags so avoid using the double-quote in your description..
  11. Type the path to the folder into your browser, as before. There will be an error if the four Pix directories don't contain the same number of files..
  12. If you change the directory names 800x800 or 240x240 (perhaps because you have decided on different sized thumbnails and larger images) amend the top of the pix/pix.php script, as indicated..
  13. Edit index.php as required!.
  14. At any future time you can add more images (and captions) and no script editing is required. Just make sure every directory has the same number of corresponding files; the script will complain if they differ.
  15. Share and donate!! Contribute ideas for improvements! Like and share! Follow!.

Tips and links for RISC OS users

Go up a
directory
level
timil.com (business site) Give some feedback. The Young Theatre Archive Tim's Blue Bike Butterwick, Lincs Holtspur, Bucks tjrh.eu (personal site) Top of page