<?php

// This is the qdgal configuration file.
// Copyright (C) 2016-2026 Mateusz Viste
// SPDX-License-Identifier: MIT

$ALBUMTITLE = 'Album';

// This regex is used to filter out the files that will be displayed as
// photos. The regex is fed directly to preg_match(), hence its syntax must
// be compatible: http://php.net/manual/en/function.preg-match.php
$PHOTOSREGEX = '/(\.jpg$)|(\.jpeg$)|(\.png$)|(\.gif$)|(\.webp$)/i';

// This regex is used to filter out the files that will be displayed as
// videos. The regex is fed directly to preg_match(), hence its syntax must
// be compatible: http://php.net/manual/en/function.preg-match.php
$VIDEOSREGEX = '/(\.mp4$)|(\.webm$)/i';

// If you'd like to use videos, then you should tell qdgal how to generate
// thumbnails for video files. The command string should contain these two
// variables: %VID, %THUMB and %HEIGHT. These will be replaced by qdgal when
// executing the command (%VID = video file, %THUMB = resulting thumbnail,
// %HEIGHT the expected height of the resulting thumbnail in pixels).
// Example:
// ffmpeg -ss 00:05 -i %VID -frames:v 1 -y -vf scale=-1:%HEIGHT -f mjpeg %THUMB
$VIDEOTHUMBCMD = 'ffmpeg -ss 00:05 -i %VID -frames:v 1 -y -vf scale=-1:%HEIGHT -f mjpeg %THUMB';

// Set the parameter below to 1 if you'd like qdgal to use the LAST image of a
// gallery as the gallery's cover (0 would be using the FIRST image).
$GALCOVER_IS_LAST = 1;

// If you'd like qdgal to generate thumbnails for image previews, set the
// parameter below to the desired height of thumbnails, in pixels. If it is
// set to 0 or a negative value, thumbnails won't be used at all.
// All thumbnails are stored in a hidden .qdgal-cache directory (this
// directory will be created automatically by qdgal when needed). This
// obviously requires that qdgal has write access to its directory.
// Thumbnails are generated for jpeg, png, gif and webp files (when GD supports them).
// It is highly recommended to allow thumbnails: it provides much better
// performances and smoother user experience.
$THUMBNAILS_HEIGHT = 480;

// Where should qdgal store its cached thumbnails.
// Defaults to a hidden '.qdgal-cache' directory
$CACHEFOLDER = '.qdgal-cache';

// Cameras may write jpeg files with their original pixel orientation and add
// an EXIF tag that specifies how the picture should be rotated at display
// time. This does not work well with browsers, they tend not to rotate the
// photo and display it wrongly. AUTOROTATE=1 makes qdgal rotate pixels of the
// photo according to the exif tag, and update the jpeg file accordingly.
// This operation, when enabled, is performed during thumbnail creation.
// Warning: this rewrites the original file (EXIF is stripped; JPEG is
// re-encoded at high quality). Keep backups if you care about bit-exact originals.
$AUTOROTATE = 1;

// Set this to 1 if you want to allow sub-galleries to use customized css
// styles. When set to 1, qdgal will try to overload default styles with the
// qdgal.css file found in the sub-gallery directory (if any is present).
// Default value is 0, meaning only the qdgal.css file in the root directory
// is used.
$CUSTOM_CSS = 0;

// Photos and galleries are sorted before being displayed. Here below you
// can control whether the sorting should be performed in ascending or
// descending order, independently for photos and galleries (0 = ascending,
// 1 = descending).
$SORTREV_PHOTOS = 0;
$SORTREV_GALLERIES = 1;

// qdgal can allow the user to start a slideshow in every gallery. To enable
// this feature, set the variable below to a number larger than zero - this
// will be used as the number of seconds between each slide when user is
// watching the slideshow. Slideshow requires JS support on browser's side.
$SLIDESHOW_DELAY = 10;

// When action links are displayed (next/previous photo, etc), a bullet-like
// symbol can be displayed on their left, by default it's a little star. If
// you'd like to change this symbol, or remove it, edit the parameter below.
$ACTION_PREFIX = '&starf; ';

// By default qdgal enforces a cache revalidation of its pages every 1200s.
// To control this by yourself, change the value below (set it to -1 to
// prevent qdgal from fiddling with browser's cache setting).
$CACHELIMIT = 1200;

// Uncomment the setting below if you'd like qdgal to emit a favicon.
//$FAVICON = 'favicon.png';

// Before creating a thumbnail for a newly discovered image, qdgal can execute
// a shell command, as specified in the setting below. Any occurance of %f
// will be replaced by the image for which the thumbnail is about to be
// created. This can be useful for example to auto-rotate photos based on
// their EXIF data ($PRETHUMB_CMD = 'exiftran -ai %f');
// Note that this is executed only for images (not for video files).
$PRETHUMB_CMD = '';

// If you wish to protect your gallery with a password, use the variable
// below. Warning: this does NOT protect individual image files from being
// accessed directly by their URL! It only limits access to qdgal's interface.
// If you need a more robust protection, you'd better use the standard HTTP
// authentication, as defined within RFC 2617 (consult your web server's
// documentation for details about how to set it up).
// Note: If you do use qdgal's password protection, you are highly advised to
//       disable the index feature of your web server, if enabled.
//       On Apache, see htaccess.example in this directory.
$AUTH_PASS = '';

// If authentication is enabled ($AUTH_PASS set to a non-empty string), then
// you can set below the time a single authentication session should be
// remembered (in seconds). Default is 0, meaning "until browser quits".
// Should you set it, say, to 3600, then the user would need to
// re-authenticate himself after each hour.
$AUTH_TIME = 0;

?>
