diff options
-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); |