Viewing file: demo10.php (3.15 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Cartografía Básica del DAMA</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body text="#666666" link="#0099FF" vlink="#0099FF" alink="#0099FF" topmargin="0">
<table width="100%" border="1" cellspacing="0" cellpadding="2">
<tr>
<td width="30%"> </td>
<td width="40%"><img src="Maps/ban.gif" width="650" height="150"></td>
<td width="30%"> </td>
</tr>
<tr>
<td> </td>
<td><p> </p>
<?php
$dir = 'C:/Maps';
$dh = opendir($dir);
while (false !== ($nombre_archivo = readdir($dh))) {
$archivos[] = $nombre_archivo;
}
$u = 0;
foreach ($archivos as $v2) {
$pos = strpos ($v2, ".jpg");
if ($pos >= 1) {
$u++;
}
}
echo $u;
echo "<br>";
$lines = $u / 3;
$linesa = round($lines);
$linesb = $lines - $linesa;
$linesb = 1 + $linesb;
if ($linesb < 1) {
$linesa = $linesa - 1;
$filasadd = 2;
}
if ($linesb > 1) {
$filasadd = 1;
}
if ($linesb == 1) {
$filasadd = 0;
}
echo $linesa;
echo "<br>";
echo $filasadd;
echo "<br>";
$opend = 'c:\maps\tumbs';
@$opend_result = mkdir ($opend , 0777);
foreach ($archivos as $v) {
$pos = strpos ($v, ".jpg");
if ($pos >= 1) {
echo $v;
echo "<br>";
$v1 = $dir . "/" . $v;
$size = GetImageSize($v1);
$an = $size[0];
$la = $size[1];
$an1 = round($an);
echo $an1;
echo " x ";
$la1 = round($la);
echo $la1;
echo "<br>";
if ($an > $la) {
$la = $la * $sz;
$la = $la / $an;
$an = $sz;
}
if ($la > $an) {
$an = $an * $sz;
$an = $an / $la;
$la = $sz;
}
if ($la == $an) {
$an = $sz;
$la = $sz;
}
$size2 = filesize($v1);
$size2 = $size2 / 1024;
$size2 = round($size2);
echo $size2;
echo " Kb <br>";
$copyfile = $opend."/".$v;
$original_file =$v1;
copy($original_file , $copyfile);
//$dest = "c:\maps\\recipiente.jpg";
$img_src=imagecreatefromjpeg($v1);
$img_dst=imagecreatetruecolor($an,$la);
imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $an, $la, $an1, $la1);
$dest = $opend."/".$v;
imagejpeg($img_dst, $dest, 100);
//imagedestroy($img_dst);
$an = round($an);
//echo $an;
$la = round($la);
//echo $la;
?>
</p>
<p><img src="<?php echo $dest; ?>" width="<?php echo $an; ?>" height="<?php echo $la; ?>"></p>
<?php
imagedestroy($img_src);
imagedestroy($img_dst);
}}
?>
<table width="100%" border="1" cellspacing="0" cellpadding="4">
<tr>
<td width="33%"> </td>
<td width="33%"> </td>
<td width="33%"> </td>
</tr>
</table>
<p> </p></td>
<td> </td>
</tr>
<tr>
<td width="30%"> </td>
<td width="40%"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Todos
los derechos reservados para el DAMA<br>
Departamento Técnico Administrativo del Medio Ambiente<br>
Alcaldía Mayor de Bogotá, D.C.<br>
Bogotá - Colombia<br>
<strong>2003 - 2004</strong></font></div></td>
<td width="30%"> </td>
</tr>
</table>
<p> </p>
<p>dffdfdfdf</p>
<p>
</body>
</html>
|