diff options
author | Romain d'Alverny <rda@mageia.org> | 2011-05-25 17:17:19 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2011-05-25 17:17:19 +0000 |
commit | f8ee4cea98c218cea233348d6010ac07f992cdc5 (patch) | |
tree | b49a5c9c742721f81a99e4f5c31a42622cc490f0 | |
parent | 00946bfca2a9f0965acf87da928931a9eb59e9ff (diff) | |
download | hugs-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.php | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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); |