Ver Mensaje Individual
  #14 (permalink)  
Antiguo 08/02/2007, 07:51
okram
Invitado
 
Mensajes: n/a
Puntos:
Re: Ayuda urgente y deseperada

Listo, ya se cual es el error... No aplicaste los ultimos cambios que te dije.

Has esto, en el archivo redimensionar.php:

Busca las lineas

Código PHP:
$img_fuente = @$f1($archivo);
$img_ancho= imagesx($img_fuente);
$img_alto =imagesy($img_fuente);
$ancho = $_GET['ancho'];
$alto = $_GET['alto'];
$imagen = imagecreatetruecolor($ancho, $alto);
imagecopyresized($imagen, $img_fuente, 0, 0, 0, 0, $ancho, $alto, $img_ancho, $img_alto); 


y las reemplazas por:

Código PHP:
$img_fuente = @$f1($archivo);
//Dimensiones
$img_ancho= imagesx($img_fuente);
$img_alto =imagesy($img_fuente);
$ancho = $_GET['ancho'];
$alto = $_GET['alto'];
$diferencia_ancho = $img_ancho/$ancho;
$diferencia_alto = $img_alto/$alto;
if(
$diferencia_ancho > $diferencia_alto) {
$nuevo_ancho = $ancho;
$prop = $nuevo_ancho/$img_ancho;
$nuevo_alto = round($img_alto*$prop);
} else {
$nuevo_alto = $alto;
$prop = $nuevo_alto/$img_alto;
$nuevo_ancho = round($img_ancho*$prop);
}
 
$imagen = imagecreate($nuevo_ancho, $nuevo_alto);
imagecopyresampled($imagen, $img_fuente, 0, 0, 0, 0, $ancho, $alto, $img_ancho, $img_alto); 

Con ese cambio debería funcionar bien ahora. Compara tu codigo con el que yo estoy usando y que es el ultimo que te puse:

http://hasiandasha.com/codigo.php -> Este es el tuyo
http://www.myokram.info/codigo.php -> Este es el mio

Edita esas lineas y va a funcionar bien. Comentame si tienes algun problema

Salu2