ya intento y no me resulto...
tengo esto para cargar las fotos y mostralas tal cual en sus dimenciones originales
Código PHP:
Ver original<?php
if($_REQUEST['enviado'] == 1){
$ruta = "./imagenes/" . $_FILES['archivo']['name'];
copy($_FILES['archivo']['tmp_name'], $ruta); echo "<script>alert('El archivo subio correctamente');</script>";
}
?>
<html>
<head>
<title>Subir imagenes y mostrarlas</title>
<script>
<!--
function validar(){
if(document.getElementById('archivo').value == ''){
alert("Debe seleccionar un archivo";
return false;
}
}
-->
</script>
</head>
<body>
<form name="formulario" enctype="multipart/form-data" method="POST" action="" onsubmit="return validar(this)">
<table>
<tr>
<td colspan="2" bgcolor="Olive"><strong>Uploads de imagenes</strong></td>
</tr>
<tr>
<td>Imagen</td>
<td><input type="file" name="archivo" id="archivo"><input type="hidden" name="enviado" value="1"></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" value="Enviar"></td>
</tr>
</table>
</form>
<table>
<tr>
<td align="left"><strong>Imagenes</strong></td>
</tr>
<tr>
<td>
<?
if($auxiliar[1] == "jpg"
echo "<img src='imagenes/$file'><br>";
}
?>
</td>
</tr>
</table>
</body>
</html>
y por otro lado tengo esto para redimensionar las fotos
Código PHP:
Ver original<html>
<head>
<title>Subir imagenes y mostrarlas</title>
</head>
<body>
<?
include ("imageresize.class.php");
$source = './imagenes/mike.png'; // solo cambio esta imagen
$dest = './imagenes/thumbs/th_mike.png';
$oResize = new ImageResize($source);
?>
<h2>Original</h2>
<img src='<?php echo $source?>' />
<br />
Tamaño: <?php echo $oResize->width_s. "x".$oResize->height_s ?><br />
<form action="" method='get'>
<input type="radio" name="tipo" value="width_height" /> Por ancho y largo <br />
<input type="radio" name="tipo" value="width" /> Por ancho <br />
<input type="radio" name="tipo" value="height" /> Por alto <br />
<input type="radio" name="tipo" value="area" /> Por porcentaje de area
<br />
Ancho: <input type="text" name="width" size="5" />
<br />
Alto: <input type="text" name="height" size="5" />
<br />
Porcentaje: <input type="text" name="perc" size="5" />
<br />
<input type='submit' value="Enviar"/>
</form>
<?php
if (!empty($_GET['tipo'])) { switch ($_GET['tipo']) {
case 'width_height':
$sTipo=sprintf("Por ancho y alto:%d x %d",$_GET['width'], $_GET['height']); $oResize->resizeWidthHeight($_GET['width'], $_GET['height']);
break;
case 'width':
$sTipo=sprintf("Por ancho:%d",$_GET['width']);
$oResize->resizeWidth($_GET['width']);
break;
case 'height':
$sTipo=sprintf("Por alto:%d", $_GET['height']);
$oResize->resizeWidth($_GET['height']);
break;
case 'area':
$sTipo=sprintf("Por area:%d%%", $_GET['perc']);
$oResize->resizeArea($_GET['perc']);
break;
}
$oResize->save($dest);
?>
<h2>Procesada</h2>
<strong>Tipo de transformación</strong>: <? echo $sTipo ?><br />
<img src='<? echo $dest?>' />
<?
}
?>
</body>
</html>
y me sirve para redimencionar solo 1 foto (a la que estoi llamando)
como ago para meter las fotos que guardo arriba en una varialbe y despues a esa variable
aplicarle la redimension????