--- expose/index.php 2003/11/06 11:47:12 1.5 +++ expose/index.php 2003/11/06 14:26:31 1.6 @@ -20,7 +20,18 @@ | Version 2 along with this program; if not, visit GNU's Home Page | http://www.gnu.org/ +----------------------------------------------------------------------+ -$Id: index.php,v 1.5 2003/11/06 11:47:12 cam Exp $ +$Id: index.php,v 1.6 2003/11/06 14:26:31 cam Exp $ + + + +// CODE FOR EMBEDDING AVI/MPEG/MOV FILES IN HTML + + + + <a href="filename">click to view</a> + <img dynsrc="filename" start="mouseover" align="left" controls width="320" height="240" hspace="25"> + </a> + */ $global_var['metadata']['author'] = "Carl Johan Schedvin "; @@ -117,7 +128,10 @@ break; case 'FocalLength': - array_push($exif_headers, 'Focal Length: '. $exif_value .'mm'); + $factor = 6.49122807; + $vars = split("/",$exif_value); + $focal_length = round(($vars[0]/$vars[1])*$factor); + array_push($exif_headers, 'Focal Length: '. $focal_length .'mm'); break; case 'DateTime': @@ -238,7 +252,7 @@ if(sizeof($exif_headers) > 0) { - $exif_str .= sprintf("EXIF "); + $exif_str .= sprintf("EXIF "); foreach($exif_headers as $exif_tag) { $exif_str .= sprintf("| %s ", $exif_tag); @@ -278,12 +292,16 @@ { global $global_var, $get_vars, $pwd; $src_image = $get_vars['img']; + $cache_dir = $pwd.'/'.$global_var['path']['cache_dir']; + if(isset($global_var['external']['magick'])) { if(file_exists($pwd.'/'.$src_image)) { $src_image_sz = GetImageSize($pwd.'/'.$src_image); $resize_aspect = round(($global_var['image_sz']['default']['y'] / $src_image_sz[1])*100, 2); // DEBUG: print "Quality: ".$global_var['image_sz']['default']['ql'] ." Resize Aspect: ". $resize_aspect ."%"; + if(!file_exists($cache_dir)) + mkdir($cache_dir,0777); exec($global_var['external']['magick'] .' -geometry '.$resize_aspect.'%' @@ -329,6 +347,15 @@ return $image_files[$prev]; } + +function get_split_path() +{ + global $pwd; + + $split_path = split('/', $pwd); + + return $split_path; +} /** * Retirieves all filenames that are images exclude all * other files. It's not recursive so it only examins the @@ -346,7 +373,7 @@ $pwd_dd = opendir($path); while(($file = readdir($pwd_dd)) !== false) { if(is_file($path."/".$file) - && !eregi("^\.|^.*.php|^.*.css|^.*~",$file)) + && !eregi("^\.|^.*.php|^.*.css|^.*~|^.txt",$file)) array_push($images, $file); } } @@ -380,6 +407,9 @@ + + + if (isset($get_vars['dir']) && is_dir(rawurldecode($get_vars['dir']))) { $pwd = rawurldecode($get_vars['dir']); @@ -394,6 +424,8 @@ // print the html header before continuing processing. html_template_header(); +//if($global_var['navigation_bar']) + html_template_navbar(); if(sizeof($image_files) <= 0) { if(sizeof($dir_files) > 0) { @@ -445,7 +477,7 @@ expose: @@ -464,6 +496,9 @@ + + + /** * Prints the html footer, this contains only closing * tags for the html document and the copyright notice. @@ -473,12 +508,56 @@ global $global_var; echo <<\n - {$global_var[str_msg][copyright]}
- expose Cvs version: \$Revision: 1.5 $ - - - - + {$global_var[str_msg][copyright]}
\n + expose\n \$Revision: 1.6 $\n + \n\n +\n +\n +\n EOF; } + + + + + + +function html_template_navbar() +{ + global $get_vars; + $split_path = get_split_path(); + + if(sizeof($split_path) > 0) { + + foreach($split_path as $dir) { + if($dir!='') { + $path .= $dir.'/'; + echo << +EOT; + if($dir == '.') + $dir = 'expose'; + + echo << > \n +EOT; + } + } + if(isset($get_vars['img'])) { + echo <<