Ver Mensaje Individual
  #28 (permalink)  
Antiguo 24/11/2005, 09:01
Avatar de macabro
macabro
 
Fecha de Ingreso: enero-2003
Ubicación: venus >> ((_\
Mensajes: 254
Antigüedad: 23 años, 9 meses
Puntos: 1
Hey creo que esto es lo que quieres.
salvalo como fotochico.php
Código PHP:
<?php

header
('Content-type: image/jpeg');

list(
$width, $height) = getimagesize($imgfile);

$newwidth =  $ancho;
$newheight = $alto;

$thumb = ImageCreateTrueColor($newwidth,$newheight);
$source = imagecreatefromjpeg($imgfile);

imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

imagejpeg($thumb);
?>
Ahora donde quieres reducir la imagen haces este pequeno codigo
Código PHP:

 $imgfile
="images/photos/$img";
$newwidth =  200;
$newheight = 200;

$size = getimagesize("$imgfile");
$height = $size[1];
$width = $size[0];
       
        if (
$height > $newheight && $width > $newwidth ) {
    

echo 
"<a href='images/photos/$img' target='_blank'><img src='FotoChico.php?imgfile=images/photos/$img&alto=210&ancho=280' border='0' align='left'></a>";

         } else{
             echo 
"<img src='images/photos/$img' border='0' align='left'>"; 
             } 
espero te sirva de algo