diff options
| -rw-r--r-- | index.php | 547 | ||||
| -rw-r--r-- | readme.txt | 182 |
2 files changed, 473 insertions, 256 deletions
@@ -2,12 +2,12 @@ /*
- Single File PHP Gallery 4.11.0 (SFPG)
+ Single File PHP Gallery 4.12.0 (SFPG)
See EULA in readme.txt for commercial use
See readme.txt for configuration
- Released: 6-october-2022
+ Released: 2024-Sep-07
https://sye.dk/sfpg/
by Kenny Svalgaard
@@ -20,7 +20,7 @@ option('GALLERY_ROOT', './');
option('DATA_ROOT', './_sfpg_data/');
option('PASSWORD', '');
- option('ADMIN', FALSE); // WARNING - See description in readme.txt before setting to TRUE
+ option('ADMIN', FALSE); // WARNING - See description in readme.txt before setting to TRUE.
option('DIR_NAME_FILE', '_name.txt');
option('DIR_THUMB_FILE', '_image.jpg');
@@ -36,6 +36,7 @@ option('DIR_EXCLUDE_REGEX', '');
option('SHOW_IMAGE_EXT', FALSE);
+ option('SHOW_IMAGE_NAME_BELOW_FULL', FALSE);
option('IMAGE_SORT_REVERSE', FALSE);
option('IMAGE_SORT_BY_TIME', FALSE);
option('IMAGE_EXIF_TIME', FALSE);
@@ -59,7 +60,7 @@ option('CHARSET', 'utf-8');
option('DATE_FORMAT', 'Day Date Month Year Hour:Min:Sec');
option('DESC_EXT', '.txt');
- option('HTML_DESCRIPTIONS', FALSE); // WARNING - See description in readme.txt before configuring this option
+ option('HTML_DESCRIPTIONS', FALSE); // WARNING - See description in readme.txt before configuring this option.
option('DESC_NL_TO_BR', FALSE);
option('SORT_DIVIDER', '--');
option('SORT_ALL_NATURAL', TRUE);
@@ -68,6 +69,14 @@ option('SHOW_EXIF_INFO', TRUE);
option('SHOW_IPTC_INFO', TRUE);
option('PNG_TEXT_CHUNKS', TRUE); // Use only lower case when set to an array.
+ option('SPIDER_PASSWORD', ''); // WARNING - See description in readme.txt before setting this option.
+
+ option('WEBP_EXIF', [
+ 'COMPUTED'=>['ApertureFNumber', 'UserComment'],
+ 'IFD0'=>['Make', 'Model'],
+ 'EXIF'=>['ExposureTime', 'FNumber', 'ISOSpeedRatings', 'DateTimeOriginal', 'FocalLength']
+ ]);
+
option('SHOW_INFO_BY_DEFAULT', FALSE);
option('ROUND_CORNERS', 3);
@@ -89,7 +98,7 @@ option('THUMB_SQUARE', FALSE);
option('THUMB_ENLARGE', FALSE);
option('THUMB_JPEG_QUALITY', 75);
- option('THUMB_PNG_ALPHA', TRUE);
+ option('THUMB_TRANSPARENCY', TRUE);
option('LOW_IMAGE_RESAMPLE_QUALITY', FALSE);
option('KEYBOARD_NAVIGATION', TRUE);
@@ -118,7 +127,6 @@ option('NAVI_CHARS_MAX', 100);
option('OVERLAY_OPACITY', 0.9);
- option('FADE_DURATION_MS', 300);
option('SLIDESHOW_DELAY_SEC', 5);
option('SHOW_MAX_IMAGES', FALSE);
@@ -154,7 +162,7 @@ option('TEXT_ACTUAL_SIZE', 'Actual Size');
option('TEXT_PREVIOUS', '◄︎ Previous');
option('TEXT_NEXT', 'Next ►︎');
- option('TEXT_INFO', 'Info panel');
+ option('TEXT_INFO', '<u>I</u>nfo');
option('TEXT_INFO_LABEL', 'Information');
option('TEXT_DOWNLOAD', 'Download image');
option('TEXT_SLIDESHOW', 'Slideshow');
@@ -220,6 +228,7 @@ option('EXIF_MAP_EMBED_LINK', 'https://maps.google.com/maps?q=[lat],[long]&output=embed');
option('TEXT_PNG_CHUNKS', 'PNG text chunks');
+ option('TEXT_WEBP_EXIF', 'WebP EXIF');
option('TEXT_IPTC', 'IPTC');
option('IPTC', [
@@ -374,9 +383,13 @@ function sfpg_base64url_decode($base64url)
{
- $base64 = strtr($base64url, '-_', '+/');
- $plain = base64_decode($base64);
- return ($plain);
+ if($base64url)
+ {
+ $base64 = strtr($base64url, '-_', '+/');
+ $plain = base64_decode($base64);
+ return ($plain);
+ }
+ return '';
}
@@ -389,15 +402,15 @@ function sfpg_url_decode($string)
{
- $get = explode('*', sfpg_base64url_decode($string));
- if (is_array($get) and (count($get)==3) and (hash('sha256', $get[0].'*'.$get[1].'*'.SECURITY_PHRASE) === $get[2]) and (strpos(GALLERY_ROOT.$get[0].$get[1], '/../') === FALSE) and (strpos($get[0].$get[1], '\\') === FALSE))
- {
- return [$get[0], $get[1]];
- }
- else
+ if(is_string($string) and (strlen($string)>65)) // sha256 is 64 plus the two *
{
- return FALSE;
+ $get = explode('*', sfpg_base64url_decode($string));
+ if (is_array($get) and (count($get)==3) and (hash('sha256', $get[0].'*'.$get[1].'*'.SECURITY_PHRASE) === $get[2]) and (strpos(GALLERY_ROOT.$get[0].$get[1], '/../') === FALSE) and (strpos($get[0].$get[1], '\\') === FALSE))
+ {
+ return [$get[0], $get[1]];
+ }
}
+ return FALSE;
}
@@ -480,6 +493,10 @@ {
return 'gif';
}
+ elseif ($type == '.webp')
+ {
+ return 'webp';
+ }
return FALSE;
}
@@ -562,7 +579,7 @@ for($x=0; $x<$mpo_full_width; $x++)
{
$left_color = imagecolorat($tmp_left, $x, $y);
- $r = (int)(($left_color >> 16) & 255) * 0.299 + (($left_color >> 8) & 255) * 0.587 + (($left_color) & 255) * 0.114;
+ $r = (int)((($left_color >> 16) & 255) * 0.299 + (($left_color >> 8) & 255) * 0.587 + (($left_color) & 255) * 0.114);
if ($r > 255)
{
$r = 255;
@@ -643,7 +660,7 @@ }
- function sfpg_get_dir($dir, $for_dir_info=FALSE, $for_zip=FALSE)
+ function sfpg_get_dir($dir, $for_dir_info=FALSE, $for_zip=FALSE, $for_spider=FALSE)
{
$dirs = [];
$dirs_time = [];
@@ -724,30 +741,33 @@ $misc[] = $var;
}
}
+ closedir($directory_handle);
if ($for_dir_info)
{
$misc = 0;
}
- if (SHOW_FILES and !($for_zip and ZIP_FILES and ZIP_FILE_THUMBS)) // removes thumbnail images from being listed as images. Unless needed for zip.
+ if (!$for_spider) // never remove images when for spider
{
- foreach ($files as $val)
+ if (SHOW_FILES and !($for_zip and ZIP_FILES and ZIP_FILE_THUMBS)) // removes thumbnail images from being listed as images. Unless needed for zip.
{
- $fti = array_search($val.FILE_THUMB_EXT, $images);
- if ($fti !== FALSE)
+ foreach ($files as $val)
{
- if ($for_dir_info)
+ $fti = array_search($val.FILE_THUMB_EXT, $images);
+ if ($fti !== FALSE)
{
- $misc++;
- }
- else
- {
- array_splice($images, $fti, 1);
- array_splice($images_time, $fti, 1);
+ if ($for_dir_info)
+ {
+ $misc++;
+ }
+ else
+ {
+ array_splice($images, $fti, 1);
+ array_splice($images_time, $fti, 1);
+ }
}
}
}
}
- closedir($directory_handle);
sfpg_array_sort($dirs, $dirs_time, DIR_SORT_BY_TIME, DIR_SORT_REVERSE);
sfpg_array_sort($images, $images_time, IMAGE_SORT_BY_TIME, IMAGE_SORT_REVERSE);
sfpg_array_sort($files, $files_time, FILE_SORT_BY_TIME, FILE_SORT_REVERSE);
@@ -757,7 +777,7 @@ {
if ($dir=='')
{
- exit('GALLERY_ROOT is not is not accessible.');
+ exit('GALLERY_ROOT is not accessible.');
}
else
{
@@ -872,7 +892,32 @@ }
- function sfpg_image($image_dir, $image_file, $func, $download=FALSE)
+ function data_as_str($data)
+ {
+ if(is_array($data))
+ {
+ $res='';
+ foreach($data as $d)
+ {
+ $res.=($res!=''?', ':'').data_as_str($d);
+ }
+ return $res;
+ }
+ else
+ {
+ if(isset($data))
+ {
+ return trim((string)$data);
+ }
+ else
+ {
+ return '';
+ }
+ }
+ }
+
+
+ function sfpg_image($image_dir, $image_file, $func, $download=FALSE, $spider=FALSE)
{
$image_path_file = DATA_ROOT.$func.'/'.$image_dir.$image_file;
$image_type = sfpg_image_type($image_file);
@@ -893,16 +938,19 @@ header('Content-Disposition: filename="'.$image_file.'"');
}
readfile($image_path_file);
- exit;
+ return;
}
if ($func == 'thumb')
{
if (file_exists($image_path_file))
{
- header('Content-Type: image/'.$image_type);
- header('Content-Disposition: filename="'.$func.'_'.$image_file.'"');
- readfile($image_path_file);
- exit;
+ if (!$spider)
+ {
+ header('Content-Type: image/'.$image_type);
+ header('Content-Disposition: filename="'.$func.'_'.$image_file.'"');
+ readfile($image_path_file);
+ }
+ return;
}
else
{
@@ -912,27 +960,34 @@ $jpeg_quality = THUMB_JPEG_QUALITY;
$source_img = GALLERY_ROOT.$image_dir.$image_file;
$image_changed = FALSE;
+ if ($image_type=='webp') // the imagecreatefromstring function can't handle animated WebP images. So check for this and return/skip if found. When it gets fixed by PHP, this 'if' can be removed.
+ {
+ if (stripos(file_get_contents($source_img, false, null, 0, 40),'ANIM')!==FALSE)
+ {
+ return;
+ }
+ }
if ((MPO_FULL_IMAGE or MPO_STEREO_IMAGE) and (sfpg_ext($image_file)=='.mpo'))
{
if (!$image = sfpg_mpo_image($source_img))
{
- exit;
+ return;
}
$image_changed = TRUE;
}
elseif (!$image = imagecreatefromstring(file_get_contents($source_img)))
{
- exit;
+ return;
}
if (($func == 'thumb') and ($image_dir != ICONS_DIR))
{
sfpg_mkdir(DATA_ROOT.'info/'.$image_dir);
$image_info = [];
- if (function_exists('exif_read_data'))
+ if ((SHOW_EXIF_INFO or ROTATE_IMAGES) and function_exists('exif_read_data') and ($image_type!='webp')) // exif_read_data do not yet support the WebP format.
{
+ $exif_data = @exif_read_data(GALLERY_ROOT.$image_dir.$image_file, 'IFD0');
if (SHOW_EXIF_INFO)
{
- $exif_data = @exif_read_data(GALLERY_ROOT.$image_dir.$image_file, 'IFD0');
if ($exif_data !== FALSE)
{
if(isset($exif_data['DateTimeOriginal']))
@@ -960,7 +1015,22 @@ }
else
{
- $image_info['exifExposureTime'] = block_html($exif_data['ExposureTime'].'s');
+ $tmp = explode('/', $exif_data['ExposureTime']);
+ if (count($tmp)==2) // if input contains one /, like: "1/250"
+ {
+ $as=(string)($tmp[0]);
+ $bs=(string)($tmp[1]);
+ while ((substr($as,-1)=='0') and (substr($bs,-1)=='0') and (strlen($as)>1) and (strlen($bs)>1)) // removed tailing 0 if both sides have them, like 10/10000
+ {
+ $as=substr($as,0,-1);
+ $bs=substr($bs,0,-1);
+ }
+ $image_info['exifExposureTime'] = block_html($as.'/'.$bs.'s');
+ }
+ else
+ {
+ $image_info['exifExposureTime'] = block_html($exif_data['ExposureTime'].'s');
+ }
}
}
if(isset($exif_data['FNumber']))
@@ -991,97 +1061,23 @@ $orientation = (int)$exif_data['Orientation'];
if (($orientation>1) and ($orientation<9))
{
- $image_width = imagesx($image);
- $image_height = imagesy($image);
- switch ($orientation)
+ if (($orientation==3) or ($orientation==4))
{
- case 2:
- {
- $rotate = @imagecreatetruecolor($image_width, $image_height);
- if (LOW_IMAGE_RESAMPLE_QUALITY)
- {
- imagecopyresized($rotate, $image, 0, 0, $image_width-1, 0, $image_width, $image_height, -$image_width, $image_height);
- }
- else
- {
- imagecopyresampled($rotate, $image, 0, 0, $image_width-1, 0, $image_width, $image_height, -$image_width, $image_height);
- }
- imagedestroy($image);
- $image_changed = TRUE;
- break;
- }
- case 3:
- {
- $rotate = imagerotate($image, 180, 0);
- imagedestroy($image);
- $image_changed = TRUE;
- break;
- }
- case 4:
- {
- $rotate = @imagecreatetruecolor($image_width, $image_height);
- if (LOW_IMAGE_RESAMPLE_QUALITY)
- {
- imagecopyresized($rotate, $image, 0, 0, 0, $image_height-1, $image_width, $image_height, $image_width, -$image_height);
- }
- else
- {
- imagecopyresampled($rotate, $image, 0, 0, 0, $image_height-1, $image_width, $image_height, $image_width, -$image_height);
- }
- imagedestroy($image);
- $image_changed = TRUE;
- break;
- }
- case 5:
- {
- $rotate = imagerotate($image, 270, 0);
- imagedestroy($image);
- $image = $rotate;
- $rotate = @imagecreatetruecolor($image_height, $image_width);
- if (LOW_IMAGE_RESAMPLE_QUALITY)
- {
- imagecopyresized($rotate, $image, 0, 0, 0, $image_width-1, $image_height, $image_width, $image_height, -$image_width);
- }
- else
- {
- imagecopyresampled($rotate, $image, 0, 0, 0, $image_width-1, $image_height, $image_width, $image_height, -$image_width);
- }
- $image_changed = TRUE;
- break;
- }
- case 6:
- {
- $rotate = imagerotate($image, 270, 0);
- imagedestroy($image);
- $image_changed = TRUE;
- break;
- }
- case 7:
- {
- $rotate = imagerotate($image, 90, 0);
- imagedestroy($image);
- $image = $rotate;
- $rotate = @imagecreatetruecolor($image_height, $image_width);
- if (LOW_IMAGE_RESAMPLE_QUALITY)
- {
- imagecopyresized($rotate, $image, 0, 0, 0, $image_width-1, $image_height, $image_width, $image_height, -$image_width);
- }
- else
- {
- imagecopyresampled($rotate, $image, 0, 0, 0, $image_width-1, $image_height, $image_width, $image_height, -$image_width);
- }
- $image_changed = TRUE;
- break;
- }
- case 8:
- {
- $rotate = imagerotate($image, 90, 0);
- imagedestroy($image);
- $image_changed = TRUE;
- break;
- }
+ $image = imagerotate($image, 180, 0);
+ }
+ elseif (($orientation==5) or ($orientation==6))
+ {
+ $image = imagerotate($image, -90, 0);
+ }
+ elseif (($orientation==7) or ($orientation==8))
+ {
+ $image = imagerotate($image, 90, 0);
+ }
+ if (($orientation==2) or ($orientation==4) or ($orientation==5) or ($orientation==7))
+ {
+ imageflip($image, IMG_FLIP_HORIZONTAL);
}
- $image = $rotate;
+ $image_changed = TRUE;
}
}
}
@@ -1100,7 +1096,7 @@ }
}
}
- if (PNG_TEXT_CHUNKS and (sfpg_ext($image_file)=='.png'))
+ if (PNG_TEXT_CHUNKS and ($image_type=='png'))
{
if ($png_fp = @fopen(GALLERY_ROOT.$image_dir.$image_file, 'rb'))
{
@@ -1123,14 +1119,14 @@ list($keyword, $value) = explode("\0", $chunk_data);
if((PNG_TEXT_CHUNKS === TRUE) or ((is_array(PNG_TEXT_CHUNKS)) and (in_array(strtolower($keyword), PNG_TEXT_CHUNKS))))
{
- $png_text_chunks[]=$keyword;
- $png_text_chunks[]=$value;
+ $png_text_chunks[]=block_html($keyword);
+ $png_text_chunks[]=block_html($value);
}
}
}
else
{
- fseek($png_fp, $chunk_info['length']+4, SEEK_CUR); // skipping the chunk + crc
+ fseek($png_fp, $chunk_info['length']+4, SEEK_CUR); // skip the chunk + crc
}
}
fclose($png_fp);
@@ -1141,6 +1137,63 @@ }
}
}
+ if (WEBP_EXIF and ($image_type=='webp'))
+ {
+ if ($webp_fp = @fopen(GALLERY_ROOT.$image_dir.$image_file, 'rb'))
+ {
+ $webp_exif=[];
+ $webp_header = @unpack('a4riff/I1size/a4webp', fread($webp_fp, 12));
+ if (($webp_header['riff']=='RIFF') and ($webp_header['webp']=='WEBP')) // required WebP header
+ {
+ while(!feof($webp_fp))
+ {
+ $chunk_info = @unpack('a4type/I1size', fread($webp_fp, 8));
+ if(!$chunk_info)
+ {
+ break;
+ }
+ if($chunk_info['type'] == 'EXIF')
+ {
+ $chunk_data = fread($webp_fp, $chunk_info['size']); // read EXIF chunk from image
+ $php_mem = fopen('php://memory', 'w+'); // create php memory stream
+ fputs($php_mem, $chunk_data);
+ rewind($php_mem);
+ $exif=@exif_read_data($php_mem, null, true);
+ fclose($php_mem);
+ foreach(WEBP_EXIF as $key=>$data)
+ {
+ foreach($data as $id)
+ {
+ if(isset($exif[$key][$id]))
+ {
+ $exif_data_str=data_as_str($exif[$key][$id]);
+ if($exif_data_str!='')
+ {
+ $webp_exif[]=block_html($id);
+ $webp_exif[]=block_html($exif_data_str);
+ }
+ }
+ }
+ }
+ break; // stop searching as only one EXIF section is allowed
+ }
+ else
+ {
+ fseek($webp_fp, $chunk_info['size'], SEEK_CUR); // skip the chunk
+ }
+ if ($chunk_info['size'] & 1) // if chunk size is odd, skip the padding byte
+ {
+ fseek($webp_fp, 1, SEEK_CUR);
+ }
+ }
+ fclose($webp_fp);
+ if(count($webp_exif)>0)
+ {
+ $image_info['webpExif'] = $webp_exif;
+ }
+ }
+ }
+ }
if (WATERMARK)
{
$wm_file = GALLERY_ROOT.ICONS_DIR.WATERMARK;
@@ -1191,6 +1244,10 @@ {
imagegif($image, $new_full_img);
}
+ elseif ($image_type == 'webp')
+ {
+ imagewebp($image, $new_full_img);
+ }
}
$image_info['fileMTime'] = filemtime(GALLERY_ROOT.$image_dir.$image_file); // also used for deleting data if time have changed
$image_info['fileSize'] = sfpg_file_size(filesize(GALLERY_ROOT.$image_dir.$image_file));
@@ -1205,7 +1262,7 @@ $new_img_height = $max_width;
}
$new_image = imagecreatetruecolor($new_img_width, $new_img_height);
- if(THUMB_PNG_ALPHA and ($image_type == 'png'))
+ if(THUMB_TRANSPARENCY and (($image_type == 'png') or ($image_type == 'webp')))
{
imagealphablending($new_image, false);
imagesavealpha($new_image,true);
@@ -1236,23 +1293,43 @@ }
imagedestroy($image);
sfpg_mkdir(DATA_ROOT.$func.'/'.$image_dir);
- header('Content-type: image/'.$image_type);
- header('Content-Disposition: filename="'.$func.'_'.$image_file.'"');
+ if (!$spider)
+ {
+ header('Content-type: image/'.$image_type);
+ header('Content-Disposition: filename="'.$func.'_'.$image_file.'"');
+ }
if ($image_type == 'jpeg')
{
- imagejpeg($new_image, NULL, $jpeg_quality);
+ if (!$spider)
+ {
+ imagejpeg($new_image, null, $jpeg_quality);
+ }
imagejpeg($new_image, $image_path_file, $jpeg_quality);
}
elseif ($image_type == 'png')
{
- imagepng($new_image);
+ if (!$spider)
+ {
+ imagepng($new_image);
+ }
imagepng($new_image, $image_path_file);
}
elseif ($image_type == 'gif')
{
- imagegif($new_image);
+ if (!$spider)
+ {
+ imagegif($new_image);
+ }
imagegif($new_image, $image_path_file);
}
+ elseif ($image_type == 'webp')
+ {
+ if (!$spider)
+ {
+ imagewebp($new_image);
+ }
+ imagewebp($new_image, $image_path_file);
+ }
imagedestroy($new_image);
}
}
@@ -1610,25 +1687,26 @@ menu += '<span onclick=\"toggleInfo(showInfo);\" class=\"sfpg_button\">".sts(TEXT_INFO)."</span>';
}";
}
- echo "
- if (index)
+ if(TEXT_ACTUAL_SIZE)
{
- if (actualSize)
+ echo "
+ if (index)
{
- menu += '<span class=\"sfpg_button_on\" onclick=\"fullSize()\">".sts(TEXT_ACTUAL_SIZE)."</span>';
+ if (actualSize)
+ {
+ menu += '<span class=\"sfpg_button_on\" onclick=\"fullSize()\">".sts(TEXT_ACTUAL_SIZE)."</span>';
+ }
+ else
+ {
+ menu += '<span class=\"sfpg_button\" onclick=\"fullSize()\">".sts(TEXT_ACTUAL_SIZE)."</span>';
+ }
}
else
{
- menu += '<span class=\"sfpg_button\" onclick=\"fullSize()\">".sts(TEXT_ACTUAL_SIZE)."</span>';
+ menu += '<span class=\"sfpg_button_disabled\">".sts(TEXT_ACTUAL_SIZE)."</span>';
}
+ ";
}
- else
- {
- menu += '<span class=\"sfpg_button_disabled\">".sts(TEXT_ACTUAL_SIZE)."</span>';
- }
-
-
- ";
if (LINK_BACK)
{
echo "menu += '<span class=\"sfpg_button\" onclick=\"window.location=\'".LINK_BACK."\'\">".sts(TEXT_LINK_BACK)."</span>';
@@ -1783,6 +1861,10 @@ info += '</div>';
info += '<strong>".sts(TEXT_IMAGE_NAME)."</strong><br><div class=\"sfpg_info_text\">'+imgInfo[id]['imageName'] + '</div><br>';
";
+ if(SHOW_IMAGE_NAME_BELOW_FULL)
+ {
+ echo "gebi('box_image_full_name').innerHTML = imgInfo[id]['imageName'];";
+ }
if(PAYPAL_ENABLED)
{
echo"
@@ -1898,6 +1980,22 @@ }
";
}
+ if (WEBP_EXIF)
+ {
+ echo"
+ if (isDef(imgInfo[id]['webpExif']))
+ {
+ info += '<strong>".sts(TEXT_WEBP_EXIF)."</strong><br><div class=\"sfpg_info_text\">';
+ var brsep='';
+ for (i=0; i<imgInfo[id]['webpExif'].length; i=i+2)
+ {
+ info += brsep+'<b>'+imgInfo[id]['webpExif'][i]+'</b><br>'+imgInfo[id]['webpExif'][i+1];
+ brsep='<br><br>';
+ }
+ info += '</div><br>';
+ }
+ ";
+ }
echo"
}
else
@@ -2800,12 +2898,17 @@ if (PAYPAL_ENABLED)
{
+ $sfpg_cancel='';
+ if(isset($_GET['sfpg']) and sfpg_url_decode($_GET['sfpg']))
+ {
+ $sfpg_cancel='&sfpg='.$_GET['sfpg'];
+ }
echo "
function paypal(id)
{
var SelfUrl = '".RETURN_PROTOCOL."://".@$_SERVER['DOMAIN_NAME'].$_SERVER['PHP_SELF']."';
gebi('paypalReturn').value = SelfUrl+'?sold=1';
- gebi('paypalCancelReturn').value = SelfUrl+'?sfpg=".(sfpg_url_decode(@$_GET['sfpg'])!=FALSE?$_GET['sfpg']:'')."&info=1';
+ gebi('paypalCancelReturn').value = SelfUrl+'?info=1".$sfpg_cancel."';
gebi('paypalAmount').value = imgInfo[id]['sellPrice'];
gebi('paypalItemName').value = imgInfo[id]['imageName'];
if(isDef(imgInfo[id]['sellID']))
@@ -2910,7 +3013,7 @@ }
if (DELETE_EMPTY_DIRS and ($filed['dirDirs']===0) and ($filed['dirImages']===0) and ($filed['dirFiles']===0))
{
- sfpg_delete(GALLERY.$val.'/');
+ sfpg_delete(GALLERY_ROOT.GALLERY.$val.'/');
}
else
{
@@ -3029,7 +3132,7 @@ {
$image_info['sellPrice'] = $sell[0];
$image_info['sellStatus'] = $sell[1];
- if (trim(@$sell[2])!='')
+ if (isset($sell[2]) and (trim($sell[2])!=''))
{
$image_info['sellID'] = $sell[2];
}
@@ -3089,6 +3192,24 @@ </script>";
}
+
+ function spider($dir)
+ {
+ list($dirs, $images, $files, $misc) = sfpg_get_dir($dir,FALSE,FALSE,TRUE);
+ unset($files);
+ unset($misc);
+ foreach($images as $image)
+ {
+ sfpg_image($dir, $image, 'thumb', FALSE, TRUE);
+ }
+ unset($images);
+ foreach($dirs as $sub_dir)
+ {
+ spider($dir.$sub_dir.'/');
+ }
+ }
+
+
@include(DATA_ROOT.'sp.php');
if (!defined('SECURITY_PHRASE'))
{
@@ -3236,50 +3357,59 @@ }
}
- if (isset($_GET['cmd']) and $get_set)
+ if ($get_set)
{
- if ($_GET['cmd'] == 'thumb')
+ if (isset($_GET['cmd']))
{
- sfpg_image(GALLERY, IMAGE, 'thumb');
- exit;
- }
+ if ($_GET['cmd'] == 'thumb')
+ {
+ sfpg_image(GALLERY, IMAGE, 'thumb');
+ exit;
+ }
- if ($_GET['cmd'] == 'image')
- {
- sfpg_image(GALLERY, IMAGE, 'image');
- exit;
- }
+ if ($_GET['cmd'] == 'image')
+ {
+ sfpg_image(GALLERY, IMAGE, 'image');
+ exit;
+ }
- if (($_GET['cmd'] == 'dl') and TEXT_DOWNLOAD!='')
- {
- sfpg_image(GALLERY, IMAGE, 'image', TRUE);
- exit;
- }
+ if (($_GET['cmd'] == 'dl') and TEXT_DOWNLOAD!='')
+ {
+ sfpg_image(GALLERY, IMAGE, 'image', TRUE);
+ exit;
+ }
- if (SHOW_FILES and ($_GET['cmd'] == 'file'))
- {
- if (preg_match("#^(/|([A-Z]:)?(\\\\|/))#i", GALLERY_ROOT)) // if GALLERY_ROOT is an absolute path
+ if (SHOW_FILES and ($_GET['cmd'] == 'file'))
{
- $download_path='./_sfpg_download';
- if (is_link($download_path))
+ if (preg_match("#^(/|([A-Z]:)?(\\\\|/))#i", GALLERY_ROOT)) // if GALLERY_ROOT is an absolute path
{
- $prefix = $download_path.'/';
- }
- elseif (symlink(rtrim(GALLERY_ROOT, '/'), $download_path))
- {
- $prefix = $download_path.'/';
+ $download_path='./_sfpg_download';
+ if (is_link($download_path))
+ {
+ $prefix = $download_path.'/';
+ }
+ elseif (symlink(rtrim(GALLERY_ROOT, '/'), $download_path))
+ {
+ $prefix = $download_path.'/';
+ }
+ else
+ {
+ echo 'Unable to access file.';
+ exit;
+ }
}
else
{
- echo 'Unable to access file.';
- exit;
+ $prefix = GALLERY_ROOT;
}
+ header('Location: '.$prefix.GALLERY.IMAGE);
+ exit;
}
- else
- {
- $prefix = GALLERY_ROOT;
- }
- header('Location: '.$prefix.GALLERY.IMAGE);
+ }
+ elseif ((SPIDER_PASSWORD != '') and isset($_GET['spider']) and ($_GET['spider'] === SPIDER_PASSWORD))
+ {
+ spider(GALLERY);
+ echo 'spider_done';
exit;
}
}
@@ -3563,6 +3693,7 @@ body.sfpg
{
+ overflow-wrap:break-word;
background:'.COLOR_BODY_BACK.';
color:'.COLOR_BODY_TEXT.';
font-family:Arial, Helvetica, sans-serif;
@@ -3604,7 +3735,6 @@ {
text-align:center;
padding:0px;
- cellspacing:0px;
}
table.sfpg_disp td.menu
@@ -3800,18 +3930,18 @@ {
cursor:pointer;
border:'.FULLIMG_BORDER_WIDTH.'px solid '.COLOR_FULLIMG_BORDER.';
- width: auto;
- height : auto;
- max-height: 100%;
- max-width: 100%;
- opacity: 0;
- transition: opacity 0.5s;
+ width:auto;
+ height:auto;
+ max-height:100%;
+ max-width:100%;
+ opacity:0;
+ transition:opacity 0.5s;
}
.full_image_no_resize
{
- max-height: none;
- max-width: none;
+ max-height:none;
+ max-width:none;
}
.banner
@@ -3829,6 +3959,7 @@ .box_image, .box_wait
{
padding:30px;
+ '.(SHOW_IMAGE_NAME_BELOW_FULL?'padding-bottom:40px;':'').'
position:absolute;
top:0px;
bottom:'.MENU_BOX_HEIGHT.'px;
@@ -3855,19 +3986,18 @@ width:100%;
height:250px;
border:0;
- scrolling:no;
margin:0;
'.(ROUND_CORNERS?'border-radius:'.ROUND_CORNERS.'px;':'').'
}
.wait
{
- margin: 0;
- position: absolute;
- top: 50%;
- left: 50%;
- -ms-transform: translate(-50%, -50%);
- transform: translate(-50%, -50%);
+ margin:0;
+ position:absolute;
+ top:50%;
+ left:50%;
+ -ms-transform:translate(-50%, -50%);
+ transform:translate(-50%, -50%);
}
.box_hud
@@ -4003,7 +4133,12 @@ '</table>'.
'</div>'.
'<div id="box_image" class="box_image">'.
- '<img alt="" src="" id="full" class="full_image" onclick="closeImageView()" onmouseover="gebi(\'button_close\').className=\'sfpg_button_hover\'" onmouseout="gebi(\'button_close\').className=\'sfpg_button\'">'.
+ '<img alt="" src="data:," id="full" class="full_image" onclick="closeImageView()" onmouseover="gebi(\'button_close\').className=\'sfpg_button_hover\'" onmouseout="gebi(\'button_close\').className=\'sfpg_button\'">';
+ if(SHOW_IMAGE_NAME_BELOW_FULL)
+ {
+ echo '<div id="box_image_full_name"></div>';
+ }
+ echo
'</div>'.
'<div id="box_wait" class="box_wait">'.
'<div id="wait" class="wait"></div>'.
@@ -1,10 +1,10 @@ - Single File PHP Gallery 4.11.0 (SFPG)
+ Single File PHP Gallery 4.12.0 (SFPG)
See END USER LICENSE AGREEMENT for commercial
- Released: 6-october-2022
+ Released: 2024-Sep-07
https://sye.dk/sfpg/
By Kenny Svalgaard
@@ -77,7 +77,7 @@ FEATURES * 3D MPO red/cyan anaglyph and stereo image generation
* Keyboard navigation
* Option to add watermark to all images in gallery
- * Supports JPG, JPEG, PNG and GIF
+ * Supports JPG, JPEG, PNG, GIF, WebP and MPO
* Unlimited numbers of sub galleries
* See configuration information for all features
@@ -102,33 +102,31 @@ IMPORTANT INFORMATION ____________________________________________________________
-NEWS IN THIS VERSION
+NEWS IN THIS VERSION (4.12.0)
+ * Added a "spider" function that can be activated to generate thumbnails for new images in the gallery without having to browse the gallery.
+ * Added support for WebP images (Animated WebP images are not supported).
+ * Added WEBP_EXIF option for configuration of EXIF extraction from WebP images.
+ * Renamed THUMB_PNG_ALPHA to THUMB_TRANSPARENCY. The option now affect both PNG and WebP images.
+ * Added SHOW_IMAGE_NAME_BELOW_FULL option to allow showing the image name below the full size image.
+ * Added option to set TEXT_ACTUAL_SIZE to '' to remove the "Actual Size" button.
+ * Added shortening of EXIF ExposureTime like 10/10000. Will now be shown as 1/1000.
+ * Fixed an issue where the ROTATE_IMAGES option would only function if SHOW_EXIF_INFO was also set to TRUE.
+ * Fixed incorrect EXIF rotation for images with orientation 5 and 7.
+ * Fixed an issue where the DELETE_EMPTY_DIRS option would only function if GALLERY_ROOT was set to the default './' setting.
+ * Other minor fixes, changes and enhancements.
+
+News from previous version (4.11.0):
* Added option to extract and show PNG text chunks information.
* Fixed handling of images with corrupt EXIF date information.
-News from previous version:
+News from the version before previous version (4.10.0):
* Added zip option to allow download of galleries as zip files. Zip option is disabled by default. See zip section for configuration options.
* Added detection of inaccessible GALLERY_ROOT. Script will show an error message if GALLERY_ROOT is inaccessible.
* Added TEXT_DAYS option, to allow setting localized representation of days.
* Added TEXT_MONTHS option, to allow setting localized representation of months.
* Other minor fixes, changes and enhancements.
-News from the version before previous version:
- * Enabled script to be fully configurable from a wrapper file. See new section "USING A WRAPPER FILE".
- * Moved SECURITY_PHRASE to a separate file in the DATA_ROOT. See the "SECURITY_PHRASE" description under the DATA_ROOT option.
- * Added functionality to allow download of files stored outside web root (when GALLERY_ROOT is set to an absolute path).
- * Added TEXT_INFO_LABEL option to allow setting different text on the information box and information button. TEXT_INFO_LABEL can be set to '' to remove the information box from the information panel.
- * Added administrator option to allow choosing an image to be used as thumbnail for the directory.
- * Enhanced the HTML_DESCRIPTIONS option to allow setting a list of allowed HTML tags. It can still also be set to TRUE for all or FALSE for none.
- * Enhanced the TEXT_EXIF_MAP and EXIF_MAP_LINK options. They can now both be set to '', to remove the map link in the EXIF information panel.
- * Enhanced the EXIF_MAP_EMBED_LINK option. It can now be set to '', to remove the imbedded map in the information panel.
- * Changed so that a space is added between each line in descriptions, when DESC_NL_TO_BR is FALSE.
- * Changed all $variables in the configuration part of the script to constants, to allow overriding all options from a wrapper.
- * Changed all configuration defines to use a new option function to not trigger warnings when already defined in a wrapper.
- * Fixed issue where non-empty directories would also be deleted from the gallery root if the DELETE_EMPTY_DIRS option is enabled.
- * Minimum PHP version 7.0 is required.
- * Other minor fixes, changes and enhancements.
For changes in previous versions see here: https://sye.dk/sfpg/
@@ -147,7 +145,7 @@ ____________________________________________________________ HOW TO USE / QUICK START
The only thing you have to do is place a copy of the index.php file to any directory of your web.
-When this is done all images (jpg, jpeg, png, gif) and files if enabled, in that directory and all sub directories will be shown in the gallery.
+When this is done all images (jpg, jpeg, png, gif, WebP) and files if enabled, in that directory and all sub directories will be shown in the gallery.
By default the script will try to create a directory called "_sfpg_data" in which thumbnails and information is saved. If PHP only have write access in a certain directory, change the DATA_ROOT to point there.
@@ -207,7 +205,7 @@ KNOWN ISSUES * If a thumbnail for a given image exists, it will be used. So remember to delete old thumbnails if you make changes to the way thumbnails are created. If, for an example, you change the size of thumbnails, you will need to delete the old ones already saved, in order to have the changes apply, and have new thumbnails created. This is by design, and will not be fixed.
* First access to a gallery containing many images or directories, will take a long time to load, because the script have to create thumbnails for all the images. If the script timeout, the rest of the images will be left without thumbnails and information. Then just refresh the page and the script will continue from where it came. The directory where the script stopped might not have a thumbnail. If this is so just click the directory, and the thumbnail will be created. This is by design.
- * Single File PHP Gallery version 4.x is a stand-alone gallery. It is not designed to be included on existing pages. This is by design.
+ * Single File PHP Gallery is a stand-alone gallery. It is not designed to be included on existing pages. This is by design.
* Editing description for images, files or directories using the admin option will remove line breaks from the description file. HTML line breaks made with <br> will of course still be effective when viewing the gallery.
@@ -264,18 +262,18 @@ Creation of the sp.php file and a random SECURITY_PHRASE is handled automaticall You should however know that all links to the gallery containing the sfpg parameter uses this SECURITY_PHRASE. So if the sp.php file is deleted, all previous links to the gallery will end up in the root of the gallery.
Data stored in the DATA_ROOT also uses the SECURITY_PHRASE, so if the sp.php file is deleted or if the SECURITY_PHRASE is changed then all other contents of DATA_ROOT directory must be deleted.
-If PHP do not have write access to any useable directory, or if you have a SECURITY_PHRASE from a previous version of the script that you want to use, then follow the 5-step guide below and create your own sp.php.
+If PHP do not have write access to any useable directory, or if you have a SECURITY_PHRASE from a previous version of the script that you want to use, then follow the guide below and create your own sp.php.
To create the sp.php file manually, do this:
-1. Create the DATA_ROOT directory.
-2. Create a file called "sp.php" in the DATA_ROOT directory.
-3. Edit the sp.php file and copy this one line of code to the file:
+ 1. Create the DATA_ROOT directory.
+ 2. Create a file called "sp.php" in the DATA_ROOT directory.
+ 3. Edit the sp.php file and copy this one line of code to the file:
<?php if(function_exists('option')) option('SECURITY_PHRASE', ''); ?>
-4. Insert a random string of chars between the last two ''.
-5. Save the file.
+ 4. Insert a random string of chars between the last two ''.
+ 5. Save the file.
____________________________________________________________
@@ -388,6 +386,13 @@ To remove the thumbnail for the current directory: (Will delete the DIR_THUMB_FI 2. Click "Dir Thumb" (without selecting any images).
3. Confirm.
+To set, remove or edit description for elements in the gallery:
+ 1. Click the "Admin" button.
+ 2. Select the element (only one) that should have set, removed or edited description. The current directory is selected by default, if nothing else is selected.
+ 3. Click "Description".
+ 4. Set or edit the description and click OK - or - Click "Delete" to remove the description.
+ 5. Confirm.
+
____________________________________________________________
option('DIR_NAME_FILE', '_name.txt');
@@ -421,11 +426,11 @@ Set to TRUE to have the DIR_THUMB_FILE from the ICONS_DIR used as thumbnail on a Set to FALSE to let the script follow normal selection for directory thumbnails.
Order for selection of thumbnails for a directories (the first existing image is chosen):
-1. DIR_THUMB_FILE from the directory.
-2. If DIR_THUMB_FROM_ICONS_DIR is set to TRUE: DIR_THUMB_FILE from ICONS_DIR.
-3. First image in the directory.
-4. First DIR_THUMB_FILE or image from subdirectories.
-5. DIR_THUMB_FILE from ICONS_DIR.
+ 1. DIR_THUMB_FILE from the directory.
+ 2. If DIR_THUMB_FROM_ICONS_DIR is set to TRUE: DIR_THUMB_FILE from ICONS_DIR.
+ 3. First image in the directory.
+ 4. First DIR_THUMB_FILE or image from subdirectories.
+ 5. DIR_THUMB_FILE from ICONS_DIR.
____________________________________________________________
@@ -519,6 +524,13 @@ Set to FALSE to not show image name extensions. ____________________________________________________________
+option('SHOW_IMAGE_NAME_BELOW_FULL', FALSE);
+
+Set to TRUE to show the image name below the full size image.
+Set to FALSE to not the show image name below the full size image.
+
+
+____________________________________________________________
option('IMAGE_SORT_REVERSE', FALSE);
Set to TRUE to sort images in reverse order (highest to lowest).
@@ -581,12 +593,12 @@ If GALLERY_ROOT is set to an absolute path and SHOW_FILES is set to TRUE, then a If PHP do not have write access to script directory, this link can't be created and you will get a message saying "Unable to access file." when trying to download a file. To fix this create the "_sfpg_download" link manually, like this:
For Windows:
-1. In a Command Prompt go to the script directory.
-2. Run this command (insert the path from your GALLERY_ROOT except the last / instead of X): mklink /d _sfpg_download "X"
+ 1. In a Command Prompt go to the script directory.
+ 2. Run this command (insert the path from your GALLERY_ROOT except the last / instead of X): mklink /d _sfpg_download "X"
For Linux:
-1. In a Terminal go to the script directory.
-2. Run this command (insert the path from your GALLERY_ROOT except the last / instead of X): ln -s "X" _sfpg_download
+ 1. In a Terminal go to the script directory.
+ 2. Run this command (insert the path from your GALLERY_ROOT except the last / instead of X): ln -s "X" _sfpg_download
TIP: Use FILE_EXCLUDE, FILE_EXT_EXCLUDE and FILE_EXCLUDE_REGEX to exclude files you do not want to have displayed.
@@ -662,7 +674,7 @@ option('FILE_EXT_EXCLUDE', ['.php', '.txt', '.sell']); Set an array of file extensions for files that should not be shown in the gallery.
-INFO 1: Extensions should be entered in low case with a dot in front, like the examples below.
+INFO 1: Extensions should be entered in lower case with a dot in front, like the examples below.
INFO 2: Exclusions works only on non-supported file types. You cannot exclude the supported image types.
INFO 3: Exclusion is not case sensitive. If you exclude ".txt", all files with the following extensions will be excluded: ".txt", ".Txt", ".TXT" and so on.
@@ -850,13 +862,76 @@ Set to TRUE to extract and show all PNG text chunks. Set to an array of selected PNG text chunks to extract and show.
Set to FALSE to not extract or show PNG text chunks.
-INFO 1: When setting to an array, all keywords should be entered in low case.
+INFO 1: When setting to an array, all keywords should be entered in lower case.
INFO 2: The extraction of information is done when the thumbnail is generated. So changing what is extracted requires you to delete the contents of the DATA_ROOT, to have new thumbnails generated.
Example array configuration: option('PNG_TEXT_CHUNKS', ['title', 'author', 'description']);
____________________________________________________________
+option('SPIDER_PASSWORD', '');
+
+This option can be used to have the gallery script generate thumbnails for new images in the gallery without having to browse the gallery.
+This can lower the waiting time when entering a directory containing many new and/or large images.
+
+To activate the spider function:
+
+ 1. Set a password in the SPIDER_PASSWORD option.
+
+ 2. In the gallery, click the directory where you want the spider to start. Thumbnails for all new images in this directory and all subdirectories will be generated.
+ If you want it to generate thumbnails for the entire gallery, then click the "Home" link in the bottom of the gallery.
+ You should now have an URL in your browser containig the long sfpg= parameter, which is needed.
+
+ 3. Add this string to the end of the URL (where xxx is the SPIDER_PASSWORD that you have set): &spider=xxx
+
+An example from my demo gallery. This is the URL I get when I click the "Home":
+https://sye.dk/sfpg/demo/index.php?sfpg=Kio0YWYzNzViZWY3NDMzYWIyN2UzOGZjOTQ2YzE5NTc5Y2ZlNzM5NzI4MzQxYjMyNjYxNzM3MGM1ZDhiNGE4OGRi&info=0
+To activate the spider on my gallery, I set the SPIDER_PASSWORD and add &spider=xxx to the end of the URL, like this:
+https://sye.dk/sfpg/demo/index.php?sfpg=Kio0YWYzNzViZWY3NDMzYWIyN2UzOGZjOTQ2YzE5NTc5Y2ZlNzM5NzI4MzQxYjMyNjYxNzM3MGM1ZDhiNGE4OGRi&info=0&spider=xxx
+
+No output will be sent before the spider have finished. So if there are many new images and the spider request times out, nothing will be returned.
+You can then call the same URL again, to have the spider continue from where it ended.
+When the spider finishes this string will be returned: spider_done
+
+You can schedule a job to run, where wget is used to trigger the spider function, like this:
+wget -qO- "https://sye.dk/sfpg/demo/index.php?sfpg=Kio0YWYzNzViZWY3NDMzYWIyN2UzOGZjOTQ2YzE5NTc5Y2ZlNzM5NzI4MzQxYjMyNjYxNzM3MGM1ZDhiNGE4OGRi&info=0&spider=xxx"
+
+You could then have a script check the output, and if the output is not spider_done, then call wget again.
+
+
+____________________________________________________________
+option('WEBP_EXIF', [
+ 'COMPUTED'=>['ApertureFNumber', 'UserComment'],
+ 'IFD0'=>['Make', 'Model'],
+ 'EXIF'=>['ExposureTime', 'FNumber', 'ISOSpeedRatings', 'DateTimeOriginal', 'FocalLength']
+]);
+
+Set to an array of arrays of EXIF information to extract from WebP images. See examples below.
+Set to FALSE to not extract EXIF information from WebP images.
+
+Configuration Tool:
+Configuring this option manually can be quite difficult, as it require knowledge about where in the EXIF part of the WebP image the wanted information is stored.
+I have made a tool called "SFPG WebP EXIF Configuration Tool", to make configuring this option easier.
+SFPG WebP EXIF Configuration Tool takes a WebP image as input. It will show a list of the EXIF elements found in the image. You can then simply mark the wanted information and have the tool generate the configuration.
+You can find the tool for download on the SFPG page.
+
+INFO: This option is case sensitive.
+
+Example setting for disabling WebP EXIF extraction:
+ option('WEBP_EXIF', FALSE);
+
+Example setting for extracting only UserComment from the COMPUTED section:
+ option('WEBP_EXIF',['COMPUTED'=>['UserComment']]);
+
+Example setting for extracting different information from different sections:
+ option('WEBP_EXIF', [
+ 'COMPUTED'=>['ApertureFNumber', 'UserComment'],
+ 'IFD0'=>['Make', 'Model'],
+ 'EXIF'=>['ExposureTime', 'FNumber', 'ISOSpeedRatings', 'DateTimeOriginal', 'FocalLength']
+ ]);
+
+
+____________________________________________________________
option('SHOW_INFO_BY_DEFAULT', FALSE);
Set to TRUE to have the gallery open the Information panel by default, the user can still click the Information button to hide the panel.
@@ -882,7 +957,7 @@ Generated zip files are saved in DATA_ROOT/zip/ for when the same zip file is re To determine if a new zip file should be created, the gallery only looks at the list of elements in the zip file, not the contents of the files.
So editing a file will not generate a new zip file. But changing the name of a file will. Adding, deleting or moving files in the gallery will also generate a new zip file.
-A symbolic link "_sfpg_zip" will be created in the GALLERY_ROOT giving access to the zip files.
+A symbolic link "_sfpg_zip" will be created where the script is run from, giving access to the zip files.
The "_sfpg_zip" is excluded in both DIR_EXCLUDE and FILE_EXCLUDE, as on Windows a symbolic link is seen as a directory and on Linux as a file.
Cached zip files for a directory will be deleted if the source directory is deleted, moved or renamed. See the IMPORTANT INFORMATION section about the clean-up function.
@@ -894,6 +969,8 @@ option('ZIP_FILES', FALSE); Set to TRUE to include files in the zip files.
Set to FALSE to not include files in the zip files.
+INFO: If changing this option, remember to also change the TEXT_ZIP_DL accordingly.
+
____________________________________________________________
option('ZIP_FILE_THUMBS', FALSE);
@@ -910,6 +987,8 @@ WARNING: Setting this to TRUE will allow users to zip the entire gallery in one Set to TRUE to include sub galleries (sub directories) in zip files.
Set to FALSE to not include sub galleries (sub directories) in zip files.
+INFO: If changing this option, remember to also change the TEXT_ZIP_DL accordingly.
+
____________________________________________________________
option('ZIP_DESCRIPTIONS', FALSE);
@@ -1023,10 +1102,10 @@ If thumbnails have been saved on server you will have to delete them in order to ____________________________________________________________
-option('THUMB_PNG_ALPHA', TRUE);
+option('THUMB_TRANSPARENCY', TRUE);
-Set to TRUE to preserve alpha channel (transparency) for PNG thumbnails.
-Set to FALSE to not preserve alpha channel (transparency) for PNG thumbnails.
+Set to TRUE to preserve transparency (alpha channel) for PNG and WebP thumbnails.
+Set to FALSE to not preserve transparency (alpha channel) for PNG and WebP thumbnails.
____________________________________________________________
@@ -1222,12 +1301,6 @@ Set to 1 to have a solid color. ____________________________________________________________
-option('FADE_DURATION_MS', 300);
-
-Set the duration of the fade of images in milliseconds.
-
-
-____________________________________________________________
option('SLIDESHOW_DELAY_SEC', 5);
Set the number of seconds between each image in the slideshow. The next image will load in the background while the current is showing. The gallery will only change to the next image when both the time have gone, and the next image are fully loaded. So if the images are large and/or the client connection slow, then images may be displayed longer than the set value.
@@ -1475,6 +1548,7 @@ ____________________________________________________________ option('TEXT_ACTUAL_SIZE', 'Actual Size');
Text on button that can switch between fitting image to screen and actual size.
+Set to '' to remove button from menu.
____________________________________________________________
@@ -1490,7 +1564,7 @@ Text on next button. ____________________________________________________________
-option('TEXT_INFO', 'Info panel');
+option('TEXT_INFO', '<u>I</u>nfo');
Text on button that will show/hide the information panel.
Set to '' to remove button from menu.
@@ -1862,6 +1936,8 @@ Set the link to map function like Google maps. When clicked link will be launche Latitude in decimal will be filled in where this string is: [lat]
Longitude in decimal will be filled in where this string is: [long]
+OpenStreetMap can be used like this: 'https://www.openstreetmap.org/#map=19/[lat]/[long]'
+
Set to '' to not show the map link.
@@ -1890,6 +1966,12 @@ Text for the title of the PNG text chunks box in the information panel. ____________________________________________________________
+option('TEXT_WEBP_EXIF', 'WebP EXIF');
+
+Text for the title of the WebP EXIF box in the information panel.
+
+
+____________________________________________________________
option('TEXT_IPTC', 'IPTC');
Text for the title of the IPTC box.
|
