This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/handle_pixel/theme.php

30 lines
739 B
PHP
Raw Normal View History

<?php
class PixelFileHandlerTheme extends Themelet {
2009-01-04 19:54:16 +00:00
public function display_image(Page $page, Image $image) {
2009-08-09 21:00:59 +00:00
global $config;
$ilink = $image->get_image_link();
$html = "<img id='main_image' src='$ilink'>";
2009-08-09 21:00:59 +00:00
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")."<br>\n";
}
2009-07-27 23:20:22 +00:00
}
}
2009-08-09 21:00:59 +00:00
if($head) {
$page->add_block(new Block("EXIF Info", $head, "left"));
}
2009-07-27 23:20:22 +00:00
}
}
$page->add_block(new Block("Image", $html, "main", 0));
}
}
?>