diff --git a/index.php b/index.php index f31b1be..9fa6314 100644 --- a/index.php +++ b/index.php @@ -103,15 +103,17 @@ function readEXIF($file) { $emodel = $exif_idf0['Model']; $efocal = $exif_idf0['FocalLength']; - list($x,$y) = preg_split('/', $efocal); - $efocal = round($x/$y,0); + //Next is only cosmectic need but give an error due to division by zero + //list($x,$y) = preg_split('/', $efocal); + //$efocal = round($x/$y,0); $exif_exif = exif_read_data ($file,'EXIF' ,0 ); $eexposuretime = $exif_exif['ExposureTime']; $efnumber = $exif_exif['FNumber']; - list($x,$y) = preg_split('/', $efnumber); - $efnumber = round($x/$y,0); + //Next is only cosmectic need but give an error due to division by zero + //list($x,$y) = preg_split('/', $efnumber); + //$efnumber = round($x/$y,0); $eiso = $exif_exif['ISOSpeedRatings']; @@ -190,7 +192,7 @@ $dirs = array(); $dirs[] = array( "name" => $file, "date" => filemtime($currentdir . "/" . $file), - "html" => "
  • " . padstring($file) . "$label_loading
  • "); + "html" => "
  • " . padstring($file, $label_max_length) . "$label_loading
  • "); } } } @@ -221,15 +223,23 @@ if (file_exists($currentdir ."/captions.txt")) if (preg_match("/.jpg$|.gif$|.png$/i", $file)) { //Read EXIF - if ($display_exif == 1) $img_captions[$file] .= readEXIF($currentdir . "/" . $file); - + if ($display_exif == 1) + { + $exifReaden= readEXIF($currentdir . "/" . $file); + //Add to the caption all the EXIF information + $img_captions[$file] = $file.$exifReaden; + } + else + { + //If no EXIF, just use the filename as caption + $img_captions[$file] = $file; + } // Read the optionnal image title and caption in html file (image.jpg --> image.jpg.html) // Format: title::caption // Example: My cat::My cat like to roll on the floor. // If file is not provided, image filename will be used instead. checkpermissions($currentdir . "/" . $file); - $img_captions[$file] = $file; if (is_file($currentdir.'/'.$file.'.html')) { $img_captions[$file] = $file.'::'.htmlspecialchars(file_get_contents($currentdir.'/'.$file.'.html'),ENT_QUOTES); } if ($lazyload) { $files[] = array (