21 |
| http://www.gnu.org/ |
| http://www.gnu.org/ |
22 |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
23 |
$Id$ |
$Id$ |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
// CODE FOR EMBEDDING AVI/MPEG/MOV FILES IN HTML |
28 |
|
|
29 |
|
<embed src="filename" autostart="false" width="320" height="240" align="left" oncursor="play" hspace="20"> |
30 |
|
<noembed> |
31 |
|
<a href="filename">click to view</a> |
32 |
|
<img dynsrc="filename" start="mouseover" align="left" controls width="320" height="240" hspace="25"> |
33 |
|
</a> |
34 |
|
</noembed> |
35 |
*/ |
*/ |
36 |
|
|
37 |
$global_var['metadata']['author'] = "Carl Johan Schedvin <cjsc02@student.bth.se>"; |
$global_var['metadata']['author'] = "Carl Johan Schedvin <cjsc02@student.bth.se>"; |
128 |
break; |
break; |
129 |
|
|
130 |
case 'FocalLength': |
case 'FocalLength': |
131 |
array_push($exif_headers, 'Focal Length: '. $exif_value .'mm'); |
$factor = 6.49122807; |
132 |
|
$vars = split("/",$exif_value); |
133 |
|
$focal_length = round(($vars[0]/$vars[1])*$factor); |
134 |
|
array_push($exif_headers, 'Focal Length: '. $focal_length .'mm'); |
135 |
break; |
break; |
136 |
|
|
137 |
case 'DateTime': |
case 'DateTime': |
252 |
|
|
253 |
if(sizeof($exif_headers) > 0) { |
if(sizeof($exif_headers) > 0) { |
254 |
|
|
255 |
$exif_str .= sprintf("<span style=\"font-weight: bold;\">EXIF</span> "); |
$exif_str .= sprintf("<span style=\"font-weight: bold; color:#333;\">EXIF</span> "); |
256 |
|
|
257 |
foreach($exif_headers as $exif_tag) { |
foreach($exif_headers as $exif_tag) { |
258 |
$exif_str .= sprintf("| %s ", $exif_tag); |
$exif_str .= sprintf("| %s ", $exif_tag); |
292 |
{ |
{ |
293 |
global $global_var, $get_vars, $pwd; |
global $global_var, $get_vars, $pwd; |
294 |
$src_image = $get_vars['img']; |
$src_image = $get_vars['img']; |
295 |
|
$cache_dir = $pwd.'/'.$global_var['path']['cache_dir']; |
296 |
|
|
297 |
if(isset($global_var['external']['magick'])) { |
if(isset($global_var['external']['magick'])) { |
298 |
if(file_exists($pwd.'/'.$src_image)) { |
if(file_exists($pwd.'/'.$src_image)) { |
299 |
$src_image_sz = GetImageSize($pwd.'/'.$src_image); |
$src_image_sz = GetImageSize($pwd.'/'.$src_image); |
300 |
$resize_aspect = round(($global_var['image_sz']['default']['y'] / $src_image_sz[1])*100, 2); |
$resize_aspect = round(($global_var['image_sz']['default']['y'] / $src_image_sz[1])*100, 2); |
301 |
|
|
302 |
// DEBUG: print "Quality: ".$global_var['image_sz']['default']['ql'] ." Resize Aspect: ". $resize_aspect ."%"; |
// DEBUG: print "Quality: ".$global_var['image_sz']['default']['ql'] ." Resize Aspect: ". $resize_aspect ."%"; |
303 |
|
if(!file_exists($cache_dir)) |
304 |
|
mkdir($cache_dir,0777); |
305 |
|
|
306 |
exec($global_var['external']['magick'] |
exec($global_var['external']['magick'] |
307 |
.' -geometry '.$resize_aspect.'%' |
.' -geometry '.$resize_aspect.'%' |
347 |
return $image_files[$prev]; |
return $image_files[$prev]; |
348 |
} |
} |
349 |
|
|
350 |
|
|
351 |
|
function get_split_path() |
352 |
|
{ |
353 |
|
global $pwd; |
354 |
|
|
355 |
|
$split_path = split('/', $pwd); |
356 |
|
|
357 |
|
return $split_path; |
358 |
|
} |
359 |
/** |
/** |
360 |
* Retirieves all filenames that are images exclude all |
* Retirieves all filenames that are images exclude all |
361 |
* other files. It's not recursive so it only examins the |
* other files. It's not recursive so it only examins the |
373 |
$pwd_dd = opendir($path); |
$pwd_dd = opendir($path); |
374 |
while(($file = readdir($pwd_dd)) !== false) { |
while(($file = readdir($pwd_dd)) !== false) { |
375 |
if(is_file($path."/".$file) |
if(is_file($path."/".$file) |
376 |
&& !eregi("^\.|^.*.php|^.*.css|^.*~",$file)) |
&& !eregi("^\.|^.*.php|^.*.css|^.*~|^.txt",$file)) |
377 |
array_push($images, $file); |
array_push($images, $file); |
378 |
} |
} |
379 |
} |
} |
407 |
|
|
408 |
|
|
409 |
|
|
410 |
|
|
411 |
|
|
412 |
|
|
413 |
if (isset($get_vars['dir']) && is_dir(rawurldecode($get_vars['dir']))) |
if (isset($get_vars['dir']) && is_dir(rawurldecode($get_vars['dir']))) |
414 |
{ |
{ |
415 |
$pwd = rawurldecode($get_vars['dir']); |
$pwd = rawurldecode($get_vars['dir']); |
424 |
// print the html header before continuing processing. |
// print the html header before continuing processing. |
425 |
html_template_header(); |
html_template_header(); |
426 |
|
|
427 |
|
//if($global_var['navigation_bar']) |
428 |
|
html_template_navbar(); |
429 |
|
|
430 |
if(sizeof($image_files) <= 0) { |
if(sizeof($image_files) <= 0) { |
431 |
if(sizeof($dir_files) > 0) { |
if(sizeof($dir_files) > 0) { |
477 |
<title>expose: </title> |
<title>expose: </title> |
478 |
|
|
479 |
<style type="text/css"> |
<style type="text/css"> |
480 |
@import "/~ikea/style.css"; |
@import "./style.css"; |
481 |
</style> |
</style> |
482 |
|
|
483 |
<link rel="Shortcut Icon" type="image/x-icon" href="/img/favicon.ico" /> |
<link rel="Shortcut Icon" type="image/x-icon" href="/img/favicon.ico" /> |
496 |
|
|
497 |
|
|
498 |
|
|
499 |
|
|
500 |
|
|
501 |
|
|
502 |
/** |
/** |
503 |
* Prints the html footer, this contains only closing |
* Prints the html footer, this contains only closing |
504 |
* tags for the html document and the copyright notice. |
* tags for the html document and the copyright notice. |
508 |
global $global_var; |
global $global_var; |
509 |
echo <<<EOF |
echo <<<EOF |
510 |
<div id="copyright">\n |
<div id="copyright">\n |
511 |
{$global_var[str_msg][copyright]}<br /> |
{$global_var[str_msg][copyright]}<br />\n |
512 |
<a href="">expose</a> <span style="font-style: italic;">Cvs version: \$Revision$</span> |
<a href="">expose</a>\n <span style="font-style: italic;">\$Revision$</span>\n |
513 |
</div> |
</div>\n\n |
514 |
</div> |
</div>\n |
515 |
</body> |
</body>\n |
516 |
</html> |
</html>\n |
517 |
EOF; |
EOF; |
518 |
} |
} |
519 |
|
|
520 |
|
|
521 |
|
|
522 |
|
|
523 |
|
|
524 |
|
|
525 |
|
function html_template_navbar() |
526 |
|
{ |
527 |
|
global $get_vars; |
528 |
|
$split_path = get_split_path(); |
529 |
|
|
530 |
|
if(sizeof($split_path) > 0) { |
531 |
|
|
532 |
|
foreach($split_path as $dir) { |
533 |
|
if($dir!='') { |
534 |
|
$path .= $dir.'/'; |
535 |
|
echo <<<EOT |
536 |
|
<a style="text-decoration: none;" href="$php_self?dir=$path"> |
537 |
|
EOT; |
538 |
|
if($dir == '.') |
539 |
|
$dir = 'expose'; |
540 |
|
|
541 |
|
echo <<<EOT |
542 |
|
$dir</a> > \n |
543 |
|
EOT; |
544 |
|
} |
545 |
|
} |
546 |
|
if(isset($get_vars['img'])) { |
547 |
|
echo <<<EOT |
548 |
|
{$get_vars[img]} |
549 |
|
EOT; |
550 |
|
} |
551 |
|
} |
552 |
|
} |
553 |
|
|
554 |
|
|
555 |
|
|
556 |
|
|
557 |
|
|
558 |
|
|
559 |
|
|
560 |
|
function html_template_alt_resolutions() |
561 |
|
{ |
562 |
|
} |
563 |
?> |
?> |