Photodir Information & Tutorial
General Infos:
The focus of the Photodir photo gallery lies in very »simple«. All used text and data are extracted from the photos IPTC data (and EXIF data). The photos are managed on a local computer. Only a copy must be stored on the server. Photodir is only a software for displaying photos and not a photo managing tool. The displayed resized images are created on the fly by the first page visit (consider the lazy image load by thumbnails). The »simple« requires a bit of discipline.
Default plug-ins:
In the Photodir (download) are few self coded plug-ins allready included. All for the photo single page.
- IPTC photo copyright info (photo-copyright).
- EXIF GPS coordinates — a link to openstreetmap (photo-gps-coords-osm-link).
- Photo lightbox — by photo onclick (photo-lightbox).
For the deactivation of a plug-in please delete each plug-in folder.
Explanations:
- The URL-paths have included the photo file extensions to make the software simpler. (URL-paths without the file extension depends only photo files with one file extension.)
- The using of keywords (tags) for a search and for linking is without any database to much for a server. (Keywords can be displayed with a self coded plug-in.)
Photo resize file cache:
- For each photo file are a resized photo file is created, when the photo size is greater than the thumbnail, the single page or the lightbox photo.
- Recommended: Use only photos with the same size as the the single page photo or the lightbox photo.
- The resized photo files are created by the first visit of a album page or single photo page.
- The resized photos are saved in the folder "resizes".
- For refresh a thumbnail / single page photo deleted the resized photos.
- It's possible to deleted all resized photos every time, because all are newly created by the next visit of a album page or single photo page.
- Consider that the creating of the resize photos is server CPU heavy.
- For smaller photos only a symlink to the photo folder will be saved in the folder "resizes".
Album thumbnail and album title and description:
- Select a photo file from each photo folder and save it as a album photo file one level higher and rename it with the folder name.
- When more than one parent folders are exist, save a selected photo file in each parent folder and rename it with the each folder name.
- Write the album title and description in the IPTC of each album photo file.
- The album title and description are extracted from the album photo file IPTC.
- All foldnames and filenames are case sensitive.
Consider: Each photo folder must have a photo file with the same folder name in the same folder.
Hint: Mouse hover the folders and see the associated photo file.
(case sensitive)
┬
└┬photos
├┬─autumn
│├─spring
│├┬summer
││├─2010
││├┬2020
│││├─07-July
│││├─08-August
│││└┬07-July.JPG → Thumbnail and IPTC for album "summer/2020/07-July/".
│││ └08-August.JPG → Thumbnail and IPTC for album "summer/2020/08-August/".
││├─2010.JPG → Thumbnail and IPTC for album "summer/2010/".
││└─2020.JPG → Thumbnail and IPTC for album "summer/2020/".
│├─winter
│├─autumn.jpg → Thumbnail and IPTC for album "autumn/".
│├─spring.JPG → Thumbnail and IPTC for album "spring/".
│├─summer.JPG → Thumbnail and IPTC for album "summer/".
│└─winter.jpg → Thumbnail and IPTC for album "winter/".
└photos.jpg → IPTC for startpage.
Sort photos and albums:
- The default sort is the server system regular alphabetic sort.
- Sort the photos and albums with his filenames and foldnames.
- Default server sort:
- Manual assisted server sort (Linux):
- 05-May
- 08-August
- 12-December
Recommended restrictions:
- Filename:
- Filenames only with a-Z and 0-9 and - (Pict-12345.jpg or PICT-12345.JPG).
- No filenames with underline "_".
- No filenames with whitespace " ".
- No filenames with umlaut or eszett (ä ö ü ß).
- No filenames with special characters.
IPTC/EXIF:
- Save the data with the character set UTF-8.
- Use this HTML entities when it is text:
- Please don't use HTML in the first 200 letters, because of the HTML head metatag "description".
- Line breaks are automatically converted.
- For leading spaces in a line use non-breaking spaces ( or keyboard shortcuts).
IPTC
- Please save the IPTC data as UTF-8.
- IPTC '2#005' → "ObjectName" (Document title) is used as the album/photo title.
- IPTC '2#120' → "Caption-Abstract" (Caption / Description) is used as the album/photo description.
- ! Consider: Few software don't use the IPTC correct. Please use valid software.
- All IPTC data are saved in a PHP array variable for custom use.
- The resized thumbnails are without IPTC data.
Photo title & description
The Photo Gallery works also without IPTC and EXIF.
Title: If IPTC title don't exist, the filename without file extension is used as the title.
Description: If IPTC description don't exist, the description will be empty.
EXIF
- Please save the EXIF data as UTF-8.
- ! Consider: Few software don't use the EXIF correct. Please use valid software.
- All EXIF data are saved in a PHP array variable for custom use.
- The resized thumbnails are without EXIF data.
Installation manual & usage
Installation
- Download the Photodir zip file.
- Upload the Photodir zip file on the server.
- Unzip the Photodir zip file.
- Optional: Configurate your Photodir in the config.php file.
- Upload your photo folders in the photos directory.
Requirements
The Photodir requires PHP (version 8 and newer recommended) and PHP ImageMagick.
Usage
Beginners:
- Install the Photodir on a webhost/server.
- Upload your photo folders in the photos directory.
- ready!
Amateurs:
- Use album thumbnails.
- Use IPTC for title and description.
Experts:
- Configurate the Photodir with the config.php.
- Modify the style.
- Customize the Photodir.
Specialists:
Download Page
Modification & extensions
Modification
Custom style: The style is modifiable with CSS in the style-custom.css. This CSS will be overwrite the default CSS, except the custom code and plug-ins styles.
Own CSS files: It is possible to insert own *.css files in the HTML head via the customcode-head.php. This CSS will be overwrite the default CSS, except the plug-ins styles.
Custom code (small): The Photodir is modifiable with PHP and JavaScript in the customcode-head.php and customcode-foot.php. This is for small modifications. Read more about this directly in this files. This both files are automatically included.
Custom code (medium): For more than small custom code use the directory customcode and include the code files from that in the customcode-head.php and customcode-foot.php (PHP: include __DIR__ . "/customcode/example.php" or include __DIR__ . "/customcode/example.html"). This is for medium modifications.
Extensions (Plug-ins)
Plug-ins: The Photodir is modifiable with PHP and JavaScript via plug-ins in the directories plugins-head and plugins-foot. This is for larger modifications.
Plug-ins manual: For each plug-in create a own directory in the directory plugins-head or plugins-foot. In this own plug-in directory it is required to save a index.php (Example: plugins-foot/photo-lightbox/index.php). Via this index.php it is possible to include more files in this plug-in base file that are stored in this own plug-in directory (PHP: include __DIR__ . "/html.php") or somewhere else.
Plug-ins loading: All index.php files in all own plug-in directories in plugins-head and plugins-foot are automatically loaded.
Plug-ins sort: Sort the plug-ins by his directory names.
Annotation
Software license
- License: public domain
- License restriction: The use for contempt of living beings is not allowed.
- Author reference: © Photodir.de
Bugs & Issues
By problems and questions please write a email.