Photo-and-Map-Show (c) 2915 Jacek Olszewski jacek_olszewski@acslink.net.au
---------------------------------------------------------------------
Summary
Photo-and-Map-Show is a simple way of setting up a web based photo
show out of a collection of jpeg images placed on a www server in a
single directory. In one browser window or tab it displays a
description of the show and thumbnails of all photos. A click on a
thumbnail opens another window or tab where the photo, links to the
previous and next ones, and some information about the photo are
displayed. The information may include time, place, a map of the
place, and a comment (caption), provided the necessary data is
available in the photo exif.
Installation
The only requirement of the web server is to provide php. No need for
any data base, nor even writing permission for the user under which
the web server is running. All additional elements of the show - photo
thumbnails, their dates and times, comments (captions), locations,
maps of the areas where they have been taken - are based on data
retrieved on the run from photo exifs (see eg.
http://en.wikipedia.org/wiki/Exchangeable_image_file_format). Maps are
Google maps generated out of gps latitude and longitude recorded in
the exifs when photos are taken. The presence of the additional
elements is subject of their availability in exifs and the ability of
the php built-in function read_exif to retrieve them. If some data is
not retrievable, its representation will be missing from the page.
To make an immediate use of Photo-and-Map-Show upload the following
items to the image directory:
index.php displays description of the show and a table of the photo
thumbnails each of which is link to the photo page,
thumbnail.php extracts thumbnail from the photo exif and generates its
image,
show.php displays the photo with navigation links, its file name, and
if available: date and time, location, comment, and
the map,
functions.php functions common to index.php and show.php
redmarker.png transparent marker pointing to place of taking the photo on
map,
nothumbnail.jpg image displayed when no photo thumbnail can be found in its
exif,
Then, point your browser to the URL of the directory on the server,
eg. http://www.your.server/your-id/images/index.php (usually
index.php is not even necessary in the URL), and the photo show starts
with its description and table of thumbnails. Each thumbnail is a link
to a separate tab or page with the photo with its additional elements
and navigation links, previous and next.
Configuration
No configuration is necessary. By default, the thumbnail page starts
with "Photo Show" as its header, followed by a short explanation how
the show works, and a table of the photo thumbnails. The table is
arranged in rows of 10 images 60 px high.
The page header can easily be modified to reflect what the show is
about. It is just a matter of replacing the words in the line "<h2>
Photo Show </h2>" by more appropriate ones, in the file
index.php. There, an extended description can be inserted after the
line "<!-- Description of the show goes here, if needed -->". In the
same file the width ($w - the number of thumbnails in a row) of the
thumbnail table and the height of thumbnails ($h - in px) can be
changed.
Usage
A click on a thumbnail opens another browser window or tab where the
photo is displayed together with all additional info on its right hand
side. The size of the photo is adjusted so that its height does not
exceed 600 px. It seems an appropriate size for any screen, from
smartphone to tablet to laptop to tv. The adjustment takes place in
the browser. If the photo is saved, its original size is preserved.
The info includes links to the previous and next photos of the show,
and the file name of the current one. Also included, provided the
corresponding data have been retrieved from the photo exif, are: its
date and time, its comment (caption), and a little 320px*240px Google
map of the area where it has been taken. The map provides the usual
facilities of zooming in and out, moving in any direction, and
choosing the view between map and satellite.
Photos
Originally photo exifs do not include any comments. Comments may added by
means of various exif manipulation tools that are included in popular
graphics programs, eg. IrfanView (Image - Information - Comment) for
Windows. Linux users may find exiftool, a command line program just
for manipulating exifs, handy. Its binary is available for popular
Linux distributions (apt, rpm).
To make use of the map displaying facility of Photo-and-Map-Show,
photos should be taken with a camera or smartphone equipped with gps
and capable of recording geo coordinates in exifs of photos being
taken. There are a few such cameras on the market, and practically all
phones with gps are so capable. The sample photos have been taken
with: camera Panasonic Lumix TZ60, and phones Nokia XpressMusic,
iPhone 4s, Huawei Y300. Usually phones require some not so intuitive
changes in their settings to record geo coordinates in exifs. The
changes are to be made in gps rather than camera configuration. Eg. in
an iPhone the steps are:
1. Launch the Settings app.
2. Tap on Privacy.
3. Tap on Location Services.
4. Tap on Camera.
5. Choose While Using the App.
If fast loading of photos in browsers is important, their resizing
down to the height of 600 pixels prior to their upload is
recommended. In Photo-and-Map-Show they are so resized anyway but only
after they are downloaded by the browser.
Licence
Photo-and-Map-Show may be used free of any charges by anybody but with
no guarantee of its suitability for any particular purpose. It is the
user's responsibility for any good or bad effects the use of
Photo-and-Map-Show may bring. Anybody can use, modify and distribute
this set of scripts under GNU General Public Licence, see
http://www.gnu.org/licenses/gpl.txt.
The author will be grateful to any user who sends by email a note
including a URL of one's show, and possibly but not necessarily
comments/questions/suggestions/praises/objections/complaints/grudges/curses.
If someone finds Photo-and-Map-Show useful in earning any money, one
might consider an arbitrary donation to
jacek_olszewski@acslink.net.au.
Release Notes
Version 1.01
One change apparently required by Google Maps in Java Scripts, to generate and
use a key in referrals to https://maps.googleapis.com/maps/api.
Version 1.0
Uses make_thumb, a function written by David Walsh
(https://davidwalsh.name/create-image-thumbnail-php) instead of the php
function exif_thumbnail to display photo thumbnails. That solves the problem
of wrong direction of thumbnails of photos that have been rotated without rotation of their thumbnails in exif.
Version 0.9
includes automatic advance of images controlled by START and STOP buttons,
START immediately advances the show to the next image, then every few seconds,
STOP breaks automatic advance of images, retains the current one, and brings
back the previous and next links,
after START the speed is controlled by FASTER and SLOWER buttons,
images are numbered starting from 1 rather than from 0.
version 0.8
is the first version released to the public.