diff --git a/ext/handle_pixel/theme.php b/ext/handle_pixel/theme.php index b86323db..1fdc6a0d 100644 --- a/ext/handle_pixel/theme.php +++ b/ext/handle_pixel/theme.php @@ -2,21 +2,25 @@ class PixelFileHandlerTheme extends Themelet { public function display_image(Page $page, Image $image) { + global $config; + $ilink = $image->get_image_link(); $html = ""; - # FIXME: only read from jpegs? - $exif = @exif_read_data($image->get_image_filename(), 0, true); - if($exif) { - $head = ""; - foreach ($exif as $key => $section) { - foreach ($section as $name => $val) { - if($key == "IFD0") { - $head .= html_escape("$name: $val")."
\n"; + if($config->get_bool("image_show_meta")) { + # FIXME: only read from jpegs? + $exif = @exif_read_data($image->get_image_filename(), 0, true); + if($exif) { + $head = ""; + foreach ($exif as $key => $section) { + foreach ($section as $name => $val) { + if($key == "IFD0") { + $head .= html_escape("$name: $val")."
\n"; + } } } - } - if($head) { - $page->add_block(new Block("EXIF Info", $head, "left")); + if($head) { + $page->add_block(new Block("EXIF Info", $head, "left")); + } } } $page->add_block(new Block("Image", $html, "main", 0)); diff --git a/ext/image/main.php b/ext/image/main.php index a2477c24..ac1b5d76 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -89,6 +89,7 @@ class ImageIO extends SimpleExtension { $config->set_default_int('thumb_quality', 75); $config->set_default_int('thumb_mem_limit', parse_shorthand_int('8MB')); + $config->set_default_bool('image_show_meta', true); $config->set_default_string('image_ilink', ''); $config->set_default_string('image_tlink', ''); $config->set_default_string('image_tip', '$tags // $size // $filesize'); @@ -131,6 +132,7 @@ class ImageIO extends SimpleExtension { //$sb->add_text_option("image_tlink", "
Thumbnail link: "); $sb->add_text_option("image_tip", "Image tooltip: "); $sb->add_choice_option("upload_collision_handler", array('Error'=>'error', 'Merge'=>'merge'), "
Upload collision handler: "); + $sb->add_bool_option("image_show_meta", "
Show metadata: "); $event->panel->add_block($sb); $thumbers = array();