diff options
Diffstat (limited to 'www/inc')
-rw-r--r-- | www/inc/config.inc.php | 33 | ||||
-rw-r--r-- | www/inc/exif.inc.php | 236 |
2 files changed, 78 insertions, 191 deletions
diff --git a/www/inc/config.inc.php b/www/inc/config.inc.php index cdbcb8c..14e8ad8 100644 --- a/www/inc/config.inc.php +++ b/www/inc/config.inc.php @@ -44,12 +44,6 @@ $scnamegallery = "Photo Gallery Index"; // initialy not as lovely $app["url"] = "http://jimmac.musichall.cz/original.php3"; $app["version"] = "0.12pre"; -# =========================================================================== -# EXIF metadata app path (helper app for php3 and older php4) -# uncomment the method you want to use if you want EXIF data reported -# --------------------------------------------------------------------------- -## use internal function of PHP 4: - $exif_prog = "php4"; $exif_show = array("DateTime"=>__("Time Taken"), "Make"=>__("Camera Manufacturer"), "Model"=>__("Camera Model"), @@ -59,33 +53,6 @@ $scnamegallery = "Photo Gallery Index"; "ExposureTime"=>__("Time of Exposure"), "ISOSpeedRatings"=>__("Film/Chip Sensitivity"), "Flash"=>__("Flash")); -# --------------------------------------------------------------------------- -## use metacam (give absolute path to the binary on the server): -# $exif_prog = "/usr/local/bin/metacam"; -## what EXIF data to show (if unset, all will be shown) -## some example fields for metacam: -# $exif_show = array("Image Capture Date", "Make", "Model", -# "Exposure Program", "Exposure Mode", -# "Focal Length", "Exposure Time", -# "Aperture Value", "ISO Speed Rating", "White Balance", -# "Flash", "Scene Capture Type", -# "Metering Mode", "Max Aperture Value", "Shutter Speed Value" -# ); -# --------------------------------------------------------------------------- -## use jhead (give absolute path to the binary on the server): -# $exif_prog = "/usr/local/bin/jhead"; -## what EXIF data to show (if unset, all will be shown) -## some example fields for jhead: -# $exif_show = array( -# "Date/Time", -# "Camera make", -# "Camera model", -# "Focal length", -# "Exposure time", -# "Aperture Value", -# "ISO equiv.", -# "Exposure", -# ); # =========================================================================== ## Gallery Directory # This is a path relative to the directory where original is installed diff --git a/www/inc/exif.inc.php b/www/inc/exif.inc.php index 7b8262d..00068c8 100644 --- a/www/inc/exif.inc.php +++ b/www/inc/exif.inc.php @@ -55,169 +55,89 @@ function formatEXIF ($k,$v) { } -if ($exif_prog=="php4") { - // php internal handling - // $file is LQ image - $exif_array = exif_read_data("$file"); - reset($exif_array); - if ($exif_show) reset($exif_show); - - if ($exif_array["Make"]) { // only render all this - // if there is EXIF header - // fancy table look - echo "<div id=\"exif_table\" style=\"display: none;\">\n"; - echo "<table class=\"exif\" border=\"0\">\n"; - //co ukazat (podle exif_show) - if ($exif_show) { - while (list($kx,$x) = each($exif_show)) { - while(list($k,$v)=each($exif_array)) { - if ($kx==$k) { - echo "<tr>"; - echo "<td align=\"right\">"; - echo $x; - echo ": </td>"; - echo "<td><b>"; - echo formatEXIF($k,$v); - echo "</b></td>"; - echo "</tr>\n"; - } - } - reset($exif_array); - } - } else { - //ukaze vsechno v tabulce - while(list($k,$v)=each($exif_array)) { - echo "<tr>"; - echo "<td align=\"right\">"; - echo $k; - echo ": </td>"; - echo "<td><b>"; - echo formatEXIF($k,$v); - echo "</b></td>"; - echo "</tr>\n"; - } - } - echo "<tr>\n"; - echo "<td></td>"; - echo "<td><a href=\"javascript:toggle_div('exif_table');toggle_div('exif_line');\">" . __("Less info"); - echo "</a></td>"; - echo "</tr>\n"; - echo "</table>\n"; - echo "</div>\n"; - - - - - - // selected EXIF header on one line - echo "<div id=\"exif_line\">\n"; - echo "<p class=\"exif\">"; - reset($exif_array); - if ($exif_show) reset($exif_show); - if ($exif_show) { - while (list($kx,$x) = each($exif_show)) { - while(list($k,$v)=each($exif_array)) { - if ($kx==$k) { - echo "<span title=\"$x\">"; - echo formatEXIF($k,$v); - echo "</span> | "; - } - } - reset($exif_array); - } - } else { - /* vsechny exif headers inline */ - while(list($k,$v)=each($exif_array)) { - echo "<span title=\""; - echo $k; - echo "\">"; - echo formatEXIF($k,$v); - echo "</span> | "; - } - } - - echo "<a href=\"javascript:toggle_div('exif_table');toggle_div('exif_line');\">" . __("More info"); - echo "</a></p>\n"; - echo "</div>\n"; - } - - +// Only use php4 internal handling now. +// $file is LQ image +$exif_array = exif_read_data("$file"); +reset($exif_array); +if ($exif_show) reset($exif_show); + +if ($exif_array["Make"]) { // only render all this + // if there is EXIF header + // fancy table look + echo "<div id=\"exif_table\" style=\"display: none;\">\n"; + echo "<table class=\"exif\" border=\"0\">\n"; + //co ukazat (podle exif_show) + if ($exif_show) { + while (list($kx,$x) = each($exif_show)) { + while(list($k,$v)=each($exif_array)) { + if ($kx==$k) { + echo "<tr>"; + echo "<td align=\"right\">"; + echo $x; + echo ": </td>"; + echo "<td><b>"; + echo formatEXIF($k,$v); + echo "</b></td>"; + echo "</tr>\n"; + } + } + reset($exif_array); + } + } else { + //ukaze vsechno v tabulce + while(list($k,$v)=each($exif_array)) { + echo "<tr>"; + echo "<td align=\"right\">"; + echo $k; + echo ": </td>"; + echo "<td><b>"; + echo formatEXIF($k,$v); + echo "</b></td>"; + echo "</tr>\n"; + } + } + echo "<tr>\n"; + echo "<td></td>"; + echo "<td><a href=\"javascript:toggle_div('exif_table');toggle_div('exif_line');\">" . __("Less info"); + echo "</a></td>"; + echo "</tr>\n"; + echo "</table>\n"; + echo "</div>\n"; + // selected EXIF header on one line + echo "<div id=\"exif_line\">\n"; + echo "<p class=\"exif\">"; + reset($exif_array); + if ($exif_show) reset($exif_show); + if ($exif_show) { + while (list($kx,$x) = each($exif_show)) { + while(list($k,$v)=each($exif_array)) { + if ($kx==$k) { + echo "<span title=\"$x\">"; + echo formatEXIF($k,$v); + echo "</span> | "; + } + } + reset($exif_array); + } + } else { + /* vsechny exif headers inline */ + while(list($k,$v)=each($exif_array)) { + echo "<span title=\""; + echo $k; + echo "\">"; + echo formatEXIF($k,$v); + echo "</span> | "; + } + } - -} else { - // the old code, handles e.g. metacam and jhead as EXIF extractors - // loading lq means it won't work if the convertor doesn't copy EXIF data - // (newer ImageMagick can) - // PATCHES WELCOME - exec("$exif_prog \"$gallery_dir/$galerie/lq/img-$snimek.jpg\"", $exif_data, $exif_status); - if ($exif_status!="2") { - if ($exif_style=="descriptive") { - // fancy table look - echo "<table border=\"0\" align=\"center\" class=\"exif\">\n"; - while ($x = current($exif_data)) { - eregi("^ *([^:]*): *(.*)", $x, $y); - //filter according to $exif_show array - if (!$exif_show) { //all fields shown - echo "<tr>"; - echo "<td align=\"right\">$y[1] :</td>"; - echo "<td><b>$y[2]</b></td>"; - echo "</tr>\n"; - } else { - reset($exif_show); - while ($z = current($exif_show)) { - //echo ".$z. ::: .$y[1].<br>"; - if (trim($z) == trim($y[1])) { - echo "<tr>"; - echo "<td align=\"right\">$y[1] :</td>"; - echo "<td><b>$y[2]</b></td>"; - echo "</tr>\n"; - } - next($exif_show); - } - } - next($exif_data); - } - echo "<tr>\n"; - echo "<td></td>"; - # only show if EXIF header exists - if ($y[1]!="File") { // don't show when no EXIF - echo "<td><a href=\"$ThisScript?galerie=$galerie&photo=$snimek"; - echo "&exif_style=simple&show_thumbs=$show_thumbs\">"; - echo "<b>display in-line</b></a></td>\n"; - } - echo "</tr>\n"; - echo "</table>\n"; - } else { - //simple plaintext look - echo "<p class=\"exif\" align=\"center\">"; - while ($x = current($exif_data)) { - eregi("^ *([^:]*): *(.*)", $x, $y); - if (!$exif_show) { //all fields shown - echo "$y[2] |"; - } else { - reset($exif_show); - while ($z = current($exif_show)) { - if (trim($z) == trim($y[1])) { - echo "$y[2] | "; - } - next($exif_show); - } - } - next($exif_data); - } - # only show if EXIF header exists - if ($y[1]!="File") { - echo "<a href=\"$ThisScript?galerie=$galerie&photo=$snimek"; - echo "&exif_style=descriptive&show_thumbs=$show_thumbs\">"; - echo "<b>display table</b></a>\n"; - echo "</p>\n"; - } - } - } + echo "<a href=\"javascript:toggle_div('exif_table');toggle_div('exif_line');\">" . __("More info"); + echo "</a></p>\n"; + echo "</div>\n"; } + ?> |