User Tools

Site Tools


photo_gallery

This is an old revision of the document!


Introduction

My attempt at a PHP Photo Gallery with code snippets and ideas leached from various sources around the net. The page layout and style of the 'contact sheet' is done with CSS within the same file. I have tried to keep it as simple as possible with few bells and whistles.

one_file_photo_gallery.jpg

You may be able to tell I am not a CSS or PHP expert. I just wanted something small (how about 35 lines / 1.41Kb?) with low resources that would work for me and re-create the style of the old Kodak Slides I remember as a child. With this in mind I should caution you that this script may not adhere to the best practices in design and security. If your budgie dies as a result of using it, it's not my fault!

Live Demo

A 'Live Demo' of the script is here https://www.cpcnw.co.uk/travelog/2022-07-GRASSINGTON/

Prerequisites

  1. Web server running Linux and Apache or Lighttpd plus PHP
  2. A directory source of .jpg images with lower case file names
  3. Previously created thumbnails (100 x 75 and filename_th.jpg) - please see my recent CreateThumbs Script

Description

A single php script that generates thumbnail images and presents them in a 'contact sheet' style layout similar to the old Kodak slides. Clicking on the thumbnail opens the image in a new browser tab.

trainutz.com_rcmounts.jpg

Installation

This is pretty much a manual setup. The Photo Gallery does nothing but display a contact sheet of clickable thumbnails and displays the higher resolution image in a new window when clicked.

I may at some point look into how to auto generate the thumbnails / directory. For now though it just displays photos and you'll need to manually create the sub-directory and thumbnails! Note: I have now created the 'companion script' to go with this which you can find here CreateThumbs Script

You should also be aware that if you resize your main images some image programs will wipe out your EXIF data. I use FastStone Photo Resizer under windows for that task which preserves the date and time info. ###

photo_gallery.1714568333.txt.gz · Last modified: 2024/05/01 12:58 by admin