2007-12-06 02:26:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class PixelFileHandlerTheme extends Themelet {
|
2009-01-04 11:54:16 -08:00
|
|
|
public function display_image(Page $page, Image $image) {
|
2009-08-09 22:00:59 +01:00
|
|
|
global $config;
|
|
|
|
|
2012-02-13 20:51:34 +00:00
|
|
|
$u_ilink = $image->get_image_link();
|
2012-03-14 20:24:34 +00:00
|
|
|
if($config->get_bool("image_show_meta") && function_exists("exif_read_data")) {
|
2009-08-09 22:00:59 +01:00
|
|
|
# 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")."<br>\n";
|
|
|
|
}
|
2009-07-28 00:20:22 +01:00
|
|
|
}
|
|
|
|
}
|
2009-08-09 22:00:59 +01:00
|
|
|
if($head) {
|
|
|
|
$page->add_block(new Block("EXIF Info", $head, "left"));
|
|
|
|
}
|
2009-07-28 00:20:22 +01:00
|
|
|
}
|
|
|
|
}
|
2010-08-06 20:24:31 -03:00
|
|
|
|
2012-08-15 19:46:51 +01:00
|
|
|
$html = "<img alt='main image' class='shm-main-image' id='main_image' src='$u_ilink' data-width='{$image->width}' data-height='{$image->height}'>";
|
2012-03-24 11:16:59 +00:00
|
|
|
$page->add_block(new Block("Image", $html, "main", 10));
|
2007-12-06 02:26:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|