aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--index.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/index.php b/index.php
index 14f2883..cc0a84c 100644
--- a/index.php
+++ b/index.php
@@ -27,15 +27,17 @@ if (count($images) > 0) {
$out = sprintf($img_tmpl,
str_replace($app_root, '', $img));
- // TIP use jhead -ce photo.jpg to edit photo COMMENT field
- $exif = exif_read_data($img, null, true);
- if (!is_null($exif)
- && isset($exif['COMMENT'])) {
+ if (function_exists('exif_read_data')) {
+ // TIP use jhead -ce photo.jpg to edit photo COMMENT field
+ $exif = exif_read_data($img, null, true);
+ if (!is_null($exif)
+ && isset($exif['COMMENT'])) {
- $out .= sprintf('<figcaption id="hicomment">%s</figcaption>',
- nl2br(preg_replace('`((?:https?|ftp)://\S+[[:alnum:]]/?)`si',
- '<a href="$1" rel="nofollow">$1</a>',
- trim($exif['COMMENT'][0]))));
+ $out .= sprintf('<figcaption id="hicomment">%s</figcaption>',
+ nl2br(preg_replace('`((?:https?|ftp)://\S+[[:alnum:]]/?)`si',
+ '<a href="$1" rel="nofollow">$1</a>',
+ trim($exif['COMMENT'][0]))));
+ }
}
$out = sprintf('<figure>%s</figure>', $out);