aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2011-05-25 17:17:19 +0000
committerRomain d'Alverny <rda@mageia.org>2011-05-25 17:17:19 +0000
commitf8ee4cea98c218cea233348d6010ac07f992cdc5 (patch)
treeb49a5c9c742721f81a99e4f5c31a42622cc490f0
parent00946bfca2a9f0965acf87da928931a9eb59e9ff (diff)
downloadhugs-f8ee4cea98c218cea233348d6010ac07f992cdc5.tar
hugs-f8ee4cea98c218cea233348d6010ac07f992cdc5.tar.gz
hugs-f8ee4cea98c218cea233348d6010ac07f992cdc5.tar.bz2
hugs-f8ee4cea98c218cea233348d6010ac07f992cdc5.tar.xz
hugs-f8ee4cea98c218cea233348d6010ac07f992cdc5.zip
check if exif_read_data() is here
-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);