Merge pull request #45 from Lucas-C/master

index.php caption fixes
This commit is contained in:
Tom.C. 2014-07-16 10:53:05 +02:00
commit adbb6add7d

View file

@ -211,6 +211,9 @@ if (file_exists($currentdir ."/captions.txt"))
while (!feof($file_handle) ) while (!feof($file_handle) )
{ {
$line_of_text = fgets($file_handle); $line_of_text = fgets($file_handle);
if (empty($line_of_text)) {
continue;
}
$parts = explode('/n', $line_of_text); $parts = explode('/n', $line_of_text);
foreach($parts as $img_capts) foreach($parts as $img_capts)
{ {
@ -228,6 +231,7 @@ if (file_exists($currentdir ."/captions.txt"))
if (preg_match("/.jpg$|.gif$|.png$/i", $file)) if (preg_match("/.jpg$|.gif$|.png$/i", $file))
{ {
//Read EXIF //Read EXIF
if (!array_key_exists($file, $img_captions)) {
if ($display_exif == 1) if ($display_exif == 1)
{ {
$exifReaden= readEXIF($currentdir . "/" . $file); $exifReaden= readEXIF($currentdir . "/" . $file);
@ -239,6 +243,7 @@ if (file_exists($currentdir ."/captions.txt"))
//If no EXIF, just use the filename as caption //If no EXIF, just use the filename as caption
$img_captions[$file] = $file; $img_captions[$file] = $file;
} }
}
// Read the optionnal image title and caption in html file (image.jpg --> image.jpg.html) // Read the optionnal image title and caption in html file (image.jpg --> image.jpg.html)
// Format: title::caption // Format: title::caption
// Example: My cat::My cat like to <i>roll</i> on the floor. // Example: My cat::My cat like to <i>roll</i> on the floor.