File "debug_charge_image.php"

Full Path: /home/analogde/www/download/CHESS_2022/debug_charge_image.php
File size: 2.94 KB
MIME-type: text/x-php
Charset: utf-8

<?php
session_start();

?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Description" content="Site perso,cours,ouvrages" />
<meta name="Keywords" content="WEBSITE perso " />
<meta name="Distribution" content="Global" />
<meta name="Robots" content="" />
<meta http-equiv="Content-Language" content="fr" />
<meta name="rating" content="general" />
<meta name="author" content="Patrice DELPY" />
<meta name="copyright" content="Copyright 2013" />
<meta name="generator" content="Patoche" />
<title>Patoche WEBSITE - 2013 - Template du site - en cours de développemment ...</title>
<link rel="shortcut icon" href="images/mosfet.ico" type="image/x-icon">

<style type="text/css">

#box2 {
		position:absolute;
		top: 50px;
		right: 50px;
	}
	
#img {
width: 100%;
height: 100%;
}	

</style>

<script type="text/javascript">

function scaleImg() 
{
what = document.getElementById('thepic');
actualHeight=what.height; 
actualWidth=what.width;
if (  fitsInWindow() ) 
return;
if(what.width==tableWidth())
 {
what.width=actualWidth;
what.height=actualHeight;
}
else
{
what.style.cursor = "pointer";
what.width=tableWidth();
what.height = (actualHeight/actualWidth) * what.width;
}
}

function fitsInWindow() {
   what = document.getElementById('thepic');
   var  actualWidth= what.width;
  if (actualWidth<tableWidth()) {

   return true;
  } else {
  return false;
  }
  }
  
function tableWidth()
{return windowWidth()-100;}

function windowWidth() {
if (navigator.appName=="Netscape")
return window.innerWidth;

return document.body.offsetWidth;
}  

function showOnclick()
{
what = document.getElementById('thepic');

if (actualWidth == what.width)
        return scaleImg();
else if (actualWidth > what.width)
{
what.width=actualWidth;
what.height=actualHeight;
}
}

</script>

</head>

<body>


<?php

	$repertoire_image = "/homez.65/analogde/www" .$_GET['image'];  
	list($width, $height, $type, $attr) = getimagesize($repertoire_image); 
	$taille = format_size(filesize($repertoire_image));

	$array = explode("/", $_GET['image'] );
	end($array);
	echo   $_SESSION['repertoire'] ."/" .end($array) .":  " .$width ."px"  ."&" .$height ."px" ."               " .$taille;

	echo '<div id="box2">';
	echo '<a><img id="clickback" border="0" src="images/go_back.png" onclick="history.go(-1)" style="cursor: pointer" title= "Retour"></a>';
	echo '</div>';

	echo '<div style="text-align:center;">';
	echo '<a href="#" onClick="showOnclick()"><img id="thepic" onLoad="scaleImg();"  src = '.$_GET['image'].'  ALT="Texte remplaçant l\'image"  TITLE="Image">';
	echo '</div>';


?>

<?php

function format_size($size) {
      $sizes = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB");
      if ($size == 0) { return('n/a'); } else {
      return (round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $sizes[$i]); }
}

?>



</body>
</html>