adding simple metadata handling for jpegs (needs gd)

This commit is contained in:
real_nowhereman 2008-10-08 11:45:17 +00:00
parent 1c9c056a12
commit 9b5a673af7

View File

@ -158,14 +158,29 @@ function do_bbcode_img ($action, $attributes, $content, $params, $node_object) {
$float = '';
$popup_start = '';
$popup_end = '';
$alt = $title = basename($actualpath);
$img_size = array();
// let's disable socket functions for remote files
// slow remote servers may otherwise lockup the system
if ($image_is_local) {
$img_size = @getimagesize($actualpath);
$img_info = array();
$img_size = @getimagesize($actualpath, $img_info);
$absolutepath = BLOG_BASEURL . $actualpath;
if (function_exists('iptcparse')) {
if ($img_size['mime'] == 'image/jpeg') {
// tiffs won't be supported
if(is_array($img_info)) {
$iptc = iptcparse($img_info["APP13"]);
$title = @$iptc["2#005"][0];
$alt = isset($iptc["2#120"][0])? $iptc["2#120"][0] : $title;
}
}
}
}
@ -225,10 +240,6 @@ function do_bbcode_img ($action, $attributes, $content, $params, $node_object) {
}
$alt = $title = basename($actualpath);
if (isset($attributes['popup']) && ($attributes['popup'])) {
$pop_width = ($orig_w) ? $orig_w : 800;
$pop_height = ($orig_h) ? $orig_h : 600;