exif ifd0 info in the sidebar
This commit is contained in:
		
							parent
							
								
									fc7fd8d1f7
								
							
						
					
					
						commit
						2c5a688335
					
				@ -4,6 +4,21 @@ class PixelFileHandlerTheme extends Themelet {
 | 
				
			|||||||
	public function display_image(Page $page, Image $image) {
 | 
						public function display_image(Page $page, Image $image) {
 | 
				
			||||||
		$ilink = $image->get_image_link();
 | 
							$ilink = $image->get_image_link();
 | 
				
			||||||
		$html = "<img id='main_image' src='$ilink'>";
 | 
							$html = "<img id='main_image' src='$ilink'>";
 | 
				
			||||||
 | 
							# 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";
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if($head) {
 | 
				
			||||||
 | 
									$page->add_block(new Block("EXIF Info", $head, "left"));
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		$page->add_block(new Block("Image", $html, "main", 0));
 | 
							$page->add_block(new Block("Image", $html, "main", 0));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user