Ver Mensaje Individual
  #5 (permalink)  
Antiguo 22/04/2010, 10:41
den_22
 
Fecha de Ingreso: enero-2010
Mensajes: 198
Antigüedad: 14 años, 3 meses
Puntos: 1
Respuesta: Usar libreria gd para redimensionar imagenes.

Hola, les muestro en el perfil.php yo tengo este codigo:

Código PHP:
Ver original
  1. if ($picture != "") {
  2.  
  3.     $width1 = 400;
  4.     $height1 = 400;
  5.     $inf = @GetImageSize("images/" . $picture);
  6.     $width2 = $inf[0];
  7.     $height2 = $inf[1];
  8.     $width = $width2;
  9.     $height = $height2;
  10.     if ($width > $width1) {
  11.         $factor = round(($width1 / $width), 2);
  12.         $width = $width1;
  13.         $height = $height * $factor;
  14.         $changed = 1;
  15.     }
  16.     if ($height > $height1) {
  17.         $factor1 = round(($height1 / $height), 2);
  18.         $height = $height1;
  19.         $width = $width * $factor1;
  20.         $changed = 1;
  21.     }

Hasta que punto piensan que es favorable?, el tema es que con ese codigo las imagenes nunca tienen un tamaño fijo por ejemplo de 200 x 200 , sino que cambian de acuerdo al ancho y alto que tengan.

Pero bueno, no comprendi como usar la libreria gd en mi perfil y en el upload, asi que gracias seguiré con este codigo.